forked from zuriby/Faker.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Marak/faker.js
- Loading branch information
Showing
322 changed files
with
203,189 additions
and
1,595,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -67,6 +42,7 @@ This will interpolate the format string with the value of methods `name.lastName | |
|
||
* address | ||
* zipCode | ||
* zipCodeByState | ||
* city | ||
* cityPrefix | ||
* citySuffix | ||
|
@@ -82,6 +58,11 @@ This will interpolate the format string with the value of methods `name.lastName | |
* stateAbbr | ||
* latitude | ||
* longitude | ||
* direction | ||
* cardinalDirection | ||
* ordinalDirection | ||
* nearbyGPSCoordinate | ||
* timeZone | ||
* commerce | ||
* color | ||
* department | ||
|
@@ -120,16 +101,27 @@ 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 | ||
* transactionDescription | ||
* git | ||
* branch | ||
* commitEntry | ||
* commitMessage | ||
* commitSha | ||
* shortSha | ||
* hacker | ||
* abbreviation | ||
* adjective | ||
|
@@ -142,6 +134,9 @@ This will interpolate the format string with the value of methods `name.lastName | |
* slugify | ||
* replaceSymbolWithNumber | ||
* replaceSymbols | ||
* replaceCreditCardSymbols | ||
* repeatString | ||
* regexpStyleStringParse | ||
* shuffle | ||
* mustache | ||
* createCard | ||
|
@@ -166,6 +161,9 @@ This will interpolate the format string with the value of methods `name.lastName | |
* technics | ||
* transport | ||
* dataUri | ||
* lorempixel | ||
* unsplash | ||
* lorempicsum | ||
* internet | ||
* avatar | ||
|
@@ -197,6 +195,7 @@ This will interpolate the format string with the value of methods `name.lastName | |
* lastName | ||
* findName | ||
* jobTitle | ||
* gender | ||
* prefix | ||
* suffix | ||
* title | ||
|
@@ -211,13 +210,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 | ||
|
@@ -231,8 +232,32 @@ 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 | ||
|
||
As of version `v2.0.0` faker.js has support for multiple localities. | ||
|
@@ -243,32 +268,32 @@ 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 | ||
* fi | ||
* fr | ||
* fr_CA | ||
* fr_CH | ||
* ge | ||
* id_ID | ||
* it | ||
|
@@ -277,9 +302,11 @@ faker.locale = "de"; | |
* nb_NO | ||
* nep | ||
* nl | ||
* nl_BE | ||
* pl | ||
* pt_BR | ||
* pt_PT | ||
* ro | ||
* ru | ||
* sk | ||
* sv | ||
|
@@ -292,7 +319,7 @@ faker.locale = "de"; | |
|
||
### Individual Localization Packages | ||
|
||
As of vesion `v3.0.0` faker.js supports incremental loading of locales. | ||
faker.js supports incremental loading of locales. | ||
|
||
By default, requiring `faker` will include *all* locale data. | ||
|
||
|
@@ -327,48 +354,30 @@ 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!** | ||
## Building faker.js | ||
|
||
### Meteor | ||
faker uses [gulp](http://gulpjs.com/) to automate it's build process. Each build operation is a separate task which can be run independently. | ||
|
||
#### Meteor Installation | ||
### Browser Bundle | ||
|
||
``` | ||
meteor add practicalmeteor:faker | ||
npm run browser | ||
``` | ||
|
||
#### Meteor Usage, both client and server | ||
### Building JSDocs | ||
|
||
```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. | ||
[JSDOC](https://jsdoc.app/) v3 HTML API documentation | ||
|
||
``` | ||
npm run-script build | ||
npm run jsdoc | ||
``` | ||
|
||
## Building JSDocs | ||
### Building ReadMe | ||
|
||
The `ReadMe.md` file for `faker.js` is automatically generated and should not be modified directly. All updateds to `ReadMe.md` should be perfomed in `./build/src/docs.md` and then the build script should be run. | ||
|
||
``` | ||
npm run-script doc | ||
npm run readme | ||
``` | ||
|
||
## Version Release Schedule | ||
|
@@ -381,8 +390,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: | ||
|
@@ -409,8 +419,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)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": [ | ||
|
Oops, something went wrong.