Skip to content

Commit

Permalink
Update generated docs and ReadMe
Browse files Browse the repository at this point in the history
Update Licenses
  • Loading branch information
Marak committed Aug 23, 2020
1 parent efa4c64 commit 868ab94
Show file tree
Hide file tree
Showing 43 changed files with 75,291 additions and 2,560 deletions.
4 changes: 2 additions & 2 deletions MIT-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
faker.js - Copyright (c) 2010-2015
Matthew Bergman & Marak Squires
faker.js - Copyright (c) 2020
Marak Squires
http://github.com/marak/faker.js/

faker.js was inspired by and has used data definitions from:
Expand Down
128 changes: 60 additions & 68 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,26 @@

[https://rawgit.com/Marak/faker.js/master/examples/browser/index.html](https://rawgit.com/Marak/faker.js/master/examples/browser/index.html)

## Hosted API Microservice

[http://faker.hook.io](http://faker.hook.io/)
- Supports all Faker API Methods
- Full-Featured Microservice
- Hosted by [hook.io](http://hook.io)

```bash
curl http://faker.hook.io?property=name.findName&locale=de
```

## Usage

### Browser

```html
<script src = "faker.js" type = "text/javascript"></script>
<script>
var randomName = faker.name.findName(); // Caitlyn Kerluke
var randomEmail = faker.internet.email(); // [email protected]
var randomCard = faker.helpers.createCard(); // random contact card containing many properties
</script>

```
### Node.js

```js
var faker = require('faker');

var randomName = faker.name.findName(); // Rowan Nikolaus
var randomEmail = faker.internet.email(); // [email protected]
var randomCard = faker.helpers.createCard(); // random contact card containing many properties

## API


### Faker.fake()

faker.js contains a super useful generator method `Faker.fake` for combining faker API methods using a mustache string format.

**Example:**

``` js
console.log(faker.fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}"));
// outputs: "Marks, Dean Sr."
```

This will interpolate the format string with the value of methods `name.lastName()`, `name.firstName()`, and `name.suffix()`
## API

### JSDoc API Browser

Expand All @@ -67,6 +42,7 @@ This will interpolate the format string with the value of methods `name.lastName

* address
* zipCode
* zipCodeByState
* city
* cityPrefix
* citySuffix
Expand All @@ -82,6 +58,10 @@ This will interpolate the format string with the value of methods `name.lastName
* stateAbbr
* latitude
* longitude
* direction
* cardinalDirection
* ordinalDirection
* nearbyGPSCoordinate
* commerce
* color
* department
Expand Down Expand Up @@ -120,16 +100,26 @@ This will interpolate the format string with the value of methods `name.lastName
* finance
* account
* accountName
* routingNumber
* mask
* amount
* transactionType
* currencyCode
* currencyName
* currencySymbol
* bitcoinAddress
* litecoinAddress
* creditCardNumber
* creditCardCVV
* ethereumAddress
* iban
* bic
* git
* branch
* commitEntry
* commitMessage
* commitSha
* shortSha
* hacker
* abbreviation
* adjective
Expand All @@ -142,6 +132,9 @@ This will interpolate the format string with the value of methods `name.lastName
* slugify
* replaceSymbolWithNumber
* replaceSymbols
* replaceCreditCardSymbols
* repeatString
* regexpStyleStringParse
* shuffle
* mustache
* createCard
Expand All @@ -166,6 +159,8 @@ This will interpolate the format string with the value of methods `name.lastName
* technics
* transport
* dataUri
* lorempixel
* unsplash
* internet
* avatar
* email
Expand Down Expand Up @@ -197,6 +192,7 @@ This will interpolate the format string with the value of methods `name.lastName
* lastName
* findName
* jobTitle
* gender
* prefix
* suffix
* title
Expand All @@ -211,13 +207,15 @@ This will interpolate the format string with the value of methods `name.lastName
* number
* float
* arrayElement
* arrayElements
* objectElement
* uuid
* boolean
* word
* words
* image
* locale
* alpha
* alphaNumeric
* hexaDecimal
* system
Expand All @@ -231,7 +229,31 @@ This will interpolate the format string with the value of methods `name.lastName
* directoryPath
* filePath
* semver
* time
* recent
* unique
* vehicle
* vehicle
* manufacturer
* model
* type
* fuel
* vin
* color


### Faker.fake()

faker.js contains a super useful generator method `Faker.fake` for combining faker API methods using a mustache string format.

**Example:**

``` js
console.log(faker.fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}"));
// outputs: "Marks, Dean Sr."
```

This will interpolate the format string with the value of methods `name.lastName()`, `name.firstName()`, and `name.suffix()`

## Localization

Expand All @@ -243,32 +265,31 @@ Setting a new locale is simple:

```js
// sets locale to de
faker.setLocale("de");
// or
faker.locale = "de";
```

* az
* ar
* cz
* de
* de_AT
* de_CH
* en
* en_AU
* en_AU_ocker
* en_BORK
* en_CA
* en_GB
* en_IE
* en_IND
* en_NG
* en_US
* en_ZA
* en_au_ocker
* es
* es_MX
* fa
* fr
* fr_CA
* fr_CH
* ge
* id_ID
* it
Expand All @@ -277,9 +298,11 @@ faker.locale = "de";
* nb_NO
* nep
* nl
* nl_BE
* pl
* pt_BR
* pt_PT
* ro
* ru
* sk
* sv
Expand All @@ -292,7 +315,7 @@ faker.locale = "de";

### Individual Localization Packages

As of vesion `v3.0.0` faker.js supports incremental loading of locales.
As of vesion `v3.0.0` faker.js supports incremental loading of locales.

By default, requiring `faker` will include *all* locale data.

Expand Down Expand Up @@ -327,39 +350,9 @@ console.log(firstRandom === secondRandom);

You can view a code coverage report generated in coverage/lcov-report/index.html.

## Projects Built with faker.js

### Fake JSON Schema

Use faker generators to populate JSON Schema samples.
See: https://github.com/pateketrueke/json-schema-faker/

### CLI

Run faker generators from Command Line.
See: https://github.com/lestoni/faker-cli

**Want to see your project added here? Let us know!**

### Meteor

#### Meteor Installation

```
meteor add practicalmeteor:faker
```

#### Meteor Usage, both client and server

```js
var randomName = faker.name.findName(); // Rowan Nikolaus
var randomEmail = faker.internet.email(); // [email protected]
var randomCard = faker.helpers.createCard(); // random contact card containing many properties
```

## Building faker.js

faker uses [gulp](http://gulpjs.com/) to automate its build process. Running the following build command will generate new browser builds, documentation, and code examples for the project.
faker uses [gulp](http://gulpjs.com/) to automate it's build process. Running the following build command will generate new browser builds, documentation, and code examples for the project.

```
npm run-script build
Expand All @@ -381,8 +374,9 @@ If you require the absolute latest version of `faker.js` the `master` branch @ h

#### Marak Squires

faker.js - Copyright (c) 2017
faker.js - Copyright (c) 2020
Marak Squires
www.marak.com
http://github.com/marak/faker.js/

faker.js was inspired by and has used data definitions from:
Expand All @@ -409,8 +403,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



## Backers

Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/fakerjs#backer)]
Expand Down
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"main": "./build/build/faker.js",
"homepage": "https://github.com/Marak/faker.js",
"authors": [
"Marak Squires <[email protected]>",
"Matthew Bergman <[email protected]>"
"Marak Squires <[email protected]>"
],
"description": "Generate massive amounts of fake contextual data",
"keywords": [
Expand Down
Loading

0 comments on commit 868ab94

Please sign in to comment.