faker
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -55,3 +55,2 @@ /* | ||
.pipe(rename('../examples/browser/js/faker.min.js')); | ||
}); | ||
@@ -75,13 +74,8 @@ | ||
// generate nice tree of api for docs | ||
API += '<ul>'; | ||
for (var module in faker) { | ||
API += '<li>' + module; | ||
API += '<ul>'; | ||
API += '* ' + module + '\n'; | ||
for (var method in faker[module]) { | ||
API += '<li>' + method + '</li>'; | ||
API += ' * ' + method + '\n'; | ||
} | ||
API += '</ul>'; | ||
API += '</li>'; | ||
} | ||
API += '</ul>'; | ||
@@ -91,3 +85,4 @@ return gulp.src('./src/docs.md') | ||
'API': API, | ||
'copyrightYear': new Date().getFullYear() | ||
'startYear': 2010, | ||
'currentYear': new Date().getFullYear() | ||
})) | ||
@@ -94,0 +89,0 @@ .pipe(rename("./Readme.md")) |
# faker.js - generate massive amounts of fake data in the browser and node.js | ||
<img src = "http://imgur.com/KiinQ.png" border = "0"> | ||
![Faker.js](http://imgur.com/KiinQ.png) | ||
[![Build Status](https://travis-ci.org/Marak/faker.js.svg?branch=master)](https://travis-ci.org/Marak/Faker.js) | ||
[![npm version](https://badge.fury.io/js/faker.svg)](http://badge.fury.io/js/faker) | ||
## Demo | ||
<a href="http://marak.com/faker.js/">http://marak.com/faker.js/</a> | ||
[http://marak.com/faker.js/](http://marak.com/faker.js/) | ||
## USAGE | ||
## Usage | ||
### browser - | ||
### Browser | ||
<script src = "faker.js" type = "text/javascript"></script> | ||
<script> | ||
var randomName = faker.name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.internet.email(); // Rusty@arne.info | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
</script> | ||
<script src = "faker.js" type = "text/javascript"></script> | ||
<script> | ||
var randomName = faker.name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.internet.email(); // Rusty@arne.info | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
</script> | ||
### node.js - | ||
### Node.js | ||
### usage | ||
var faker = require('./faker'); | ||
var faker = require('./faker'); | ||
var randomName = faker.name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
var randomName = faker.name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
## Dependent tools | ||
### Localization | ||
### 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 | ||
## Localization | ||
As of version `v2.0.0` faker.js supports 27 different language definition packs. | ||
@@ -50,5 +63,6 @@ | ||
## Tests | ||
npm install . | ||
make test | ||
npm install . | ||
make test | ||
You can view a code coverage report generated in coverage/lcov-report/index.html. | ||
@@ -58,13 +72,13 @@ | ||
####Matthew Bergman & Marak Squires | ||
#### Matthew Bergman & Marak Squires | ||
<br/> | ||
Copyright (c) {{copyrightYear}} Matthew Bergman & Marak Squires http://github.com/marak/faker.js/ | ||
<br/> | ||
faker.js - Copyright (c) 2014-2015 | ||
Matthew Bergman & Marak Squires | ||
http://github.com/marak/faker.js/ | ||
faker.js was inspired by and has used data definitions from | ||
<br/> | ||
https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis <br/> | ||
http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles <br/> | ||
faker.js was inspired by and has used data definitions from: | ||
* https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis | ||
* http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
@@ -77,6 +91,6 @@ a copy of this software and associated documentation files (the | ||
the following conditions: | ||
<br/> | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
<br/> | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
@@ -89,1 +103,3 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
@@ -71,4 +71,4 @@ var faker = require('../index'), | ||
var red = Math.floor((faker.random.number(256) + baseRed255) / 2); | ||
var green = Math.floor((faker.random.number(256) + baseRed255) / 2); | ||
var blue = Math.floor((faker.random.number(256) + baseRed255) / 2); | ||
var green = Math.floor((faker.random.number(256) + baseGreen255) / 2); | ||
var blue = Math.floor((faker.random.number(256) + baseBlue255) / 2); | ||
var redStr = red.toString(16); | ||
@@ -75,0 +75,0 @@ var greenStr = green.toString(16); |
@@ -351,4 +351,5 @@ var nl = {}; | ||
"Groningen", | ||
"Noord-Braband", | ||
"Limburg" | ||
"Noord-Brabant", | ||
"Limburg", | ||
"Flevoland" | ||
], | ||
@@ -355,0 +356,0 @@ "default_country": [ |
@@ -1,11 +0,10 @@ | ||
faker.js - Copyright (c) 2014 Matthew Bergman & Marak Squires http://github.com/marak/faker.js/ | ||
faker.js - Copyright (c) 2014-2015 | ||
Matthew Bergman & Marak Squires | ||
http://github.com/marak/faker.js/ | ||
faker.js was inspired by and has used data definitions from | ||
faker.js was inspired by and has used data definitions from: | ||
https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis | ||
http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles | ||
* https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis | ||
* http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles | ||
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
@@ -12,0 +11,0 @@ a copy of this software and associated documentation files (the |
{ | ||
"name": "faker", | ||
"description": "Generate massive amounts of fake contextual data", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"contributors": [ | ||
"Marak Squires <marak.squires@gmail.com>", | ||
"Matthew Bergman <matt@novafabrica.com>" | ||
"Matthew Bergman <matt@novafabrica.com>", | ||
"Tomasz Ducin <tomasz.ducin@gmail.com>" | ||
], | ||
@@ -9,0 +10,0 @@ "repository": { |
227
Readme.md
# faker.js - generate massive amounts of fake data in the browser and node.js | ||
<img src = "http://imgur.com/KiinQ.png" border = "0"> | ||
![Faker.js](http://imgur.com/KiinQ.png) | ||
[![Build Status](https://travis-ci.org/Marak/faker.js.svg?branch=master)](https://travis-ci.org/Marak/Faker.js) | ||
[![npm version](https://badge.fury.io/js/faker.svg)](http://badge.fury.io/js/faker) | ||
## Demo | ||
<a href="http://marak.com/faker.js/">http://marak.com/faker.js/</a> | ||
[http://marak.com/faker.js/](http://marak.com/faker.js/) | ||
## USAGE | ||
## Usage | ||
### browser - | ||
### Browser | ||
<script src = "faker.js" type = "text/javascript"></script> | ||
<script> | ||
var randomName = faker.name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.internet.email(); // Rusty@arne.info | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
</script> | ||
<script src = "faker.js" type = "text/javascript"></script> | ||
<script> | ||
var randomName = faker.name.findName(); // Caitlyn Kerluke | ||
var randomEmail = faker.internet.email(); // Rusty@arne.info | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
</script> | ||
### node.js - | ||
### Node.js | ||
### usage | ||
var faker = require('./faker'); | ||
var faker = require('./faker'); | ||
var randomName = faker.name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
var randomName = faker.name.findName(); // Rowan Nikolaus | ||
var randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz | ||
var randomCard = faker.helpers.createCard(); // random contact card containing many properties | ||
## Dependent tools | ||
### Localization | ||
### 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 | ||
## Localization | ||
As of version `v2.0.0` faker.js supports 27 different language definition packs. | ||
@@ -47,8 +60,160 @@ | ||
<ul><li>name<ul><li>firstName</li><li>lastName</li><li>findName</li><li>prefix</li><li>suffix</li></ul></li><li>address<ul><li>zipCode</li><li>city</li><li>cityPrefix</li><li>citySuffix</li><li>streetName</li><li>streetAddress</li><li>streetSuffix</li><li>secondaryAddress</li><li>county</li><li>country</li><li>state</li><li>stateAbbr</li><li>latitude</li><li>longitude</li></ul></li><li>phone<ul><li>phoneNumber</li><li>phoneNumberFormat</li><li>phoneFormats</li></ul></li><li>internet<ul><li>avatar</li><li>email</li><li>userName</li><li>domainName</li><li>domainSuffix</li><li>domainWord</li><li>ip</li><li>userAgent</li><li>color</li><li>password</li></ul></li><li>company<ul><li>suffixes</li><li>companyName</li><li>companySuffix</li><li>catchPhrase</li><li>bs</li><li>catchPhraseAdjective</li><li>catchPhraseDescriptor</li><li>catchPhraseNoun</li><li>bsAdjective</li><li>bsBuzz</li><li>bsNoun</li></ul></li><li>image<ul><li>image</li><li>avatar</li><li>imageUrl</li><li>abstract</li><li>animals</li><li>business</li><li>cats</li><li>city</li><li>food</li><li>nightlife</li><li>fashion</li><li>people</li><li>nature</li><li>sports</li><li>technics</li><li>transport</li></ul></li><li>lorem<ul><li>words</li><li>sentence</li><li>sentences</li><li>paragraph</li><li>paragraphs</li></ul></li><li>helpers<ul><li>randomNumber</li><li>randomize</li><li>slugify</li><li>replaceSymbolWithNumber</li><li>shuffle</li><li>mustache</li><li>createCard</li><li>contextualCard</li><li>userCard</li><li>createTransaction</li></ul></li><li>date<ul><li>past</li><li>future</li><li>between</li><li>recent</li></ul></li><li>random<ul><li>number</li><li>array_element</li><li>object_element</li></ul></li><li>finance<ul><li>account</li><li>accountName</li><li>mask</li><li>amount</li><li>transactionType</li><li>currencyCode</li><li>currencyName</li><li>currencySymbol</li></ul></li><li>hacker<ul><li>abbreviation</li><li>adjective</li><li>noun</li><li>verb</li><li>ingverb</li><li>phrase</li></ul></li><li>locales<ul><li>de</li><li>de_AT</li><li>de_CH</li><li>en</li><li>en_AU</li><li>en_BORK</li><li>en_CA</li><li>en_GB</li><li>en_IND</li><li>en_US</li><li>en_au_ocker</li><li>es</li><li>fa</li><li>fr</li><li>it</li><li>ja</li><li>ko</li><li>nb_NO</li><li>nep</li><li>nl</li><li>pl</li><li>pt_BR</li><li>ru</li><li>sk</li><li>sv</li><li>vi</li><li>zh_CN</li></ul></li><li>locale<ul><li>0</li><li>1</li></ul></li><li>localeFallback<ul><li>0</li><li>1</li></ul></li><li>definitions<ul><li>name</li><li>address</li><li>company</li><li>lorem</li><li>hacker</li><li>phone_number</li><li>finance</li><li>internet</li></ul></li></ul> | ||
* name | ||
* firstName | ||
* lastName | ||
* findName | ||
* prefix | ||
* suffix | ||
* address | ||
* zipCode | ||
* city | ||
* cityPrefix | ||
* citySuffix | ||
* streetName | ||
* streetAddress | ||
* streetSuffix | ||
* secondaryAddress | ||
* county | ||
* country | ||
* state | ||
* stateAbbr | ||
* latitude | ||
* longitude | ||
* phone | ||
* phoneNumber | ||
* phoneNumberFormat | ||
* phoneFormats | ||
* internet | ||
* avatar | ||
* userName | ||
* domainName | ||
* domainSuffix | ||
* domainWord | ||
* ip | ||
* userAgent | ||
* color | ||
* password | ||
* company | ||
* suffixes | ||
* companyName | ||
* companySuffix | ||
* catchPhrase | ||
* bs | ||
* catchPhraseAdjective | ||
* catchPhraseDescriptor | ||
* catchPhraseNoun | ||
* bsAdjective | ||
* bsBuzz | ||
* bsNoun | ||
* image | ||
* image | ||
* avatar | ||
* imageUrl | ||
* abstract | ||
* animals | ||
* business | ||
* cats | ||
* city | ||
* food | ||
* nightlife | ||
* fashion | ||
* people | ||
* nature | ||
* sports | ||
* technics | ||
* transport | ||
* lorem | ||
* words | ||
* sentence | ||
* sentences | ||
* paragraph | ||
* paragraphs | ||
* helpers | ||
* randomNumber | ||
* randomize | ||
* slugify | ||
* replaceSymbolWithNumber | ||
* shuffle | ||
* mustache | ||
* createCard | ||
* contextualCard | ||
* userCard | ||
* createTransaction | ||
* date | ||
* past | ||
* future | ||
* between | ||
* recent | ||
* random | ||
* number | ||
* array_element | ||
* object_element | ||
* uuid | ||
* finance | ||
* account | ||
* accountName | ||
* mask | ||
* amount | ||
* transactionType | ||
* currencyCode | ||
* currencyName | ||
* currencySymbol | ||
* hacker | ||
* abbreviation | ||
* adjective | ||
* noun | ||
* verb | ||
* ingverb | ||
* phrase | ||
* locales | ||
* de | ||
* de_AT | ||
* de_CH | ||
* en | ||
* en_AU | ||
* en_BORK | ||
* en_CA | ||
* en_GB | ||
* en_IND | ||
* en_US | ||
* en_au_ocker | ||
* es | ||
* fa | ||
* fr | ||
* it | ||
* ja | ||
* ko | ||
* nb_NO | ||
* nep | ||
* nl | ||
* pl | ||
* pt_BR | ||
* ru | ||
* sk | ||
* sv | ||
* vi | ||
* zh_CN | ||
* locale | ||
* 0 | ||
* 1 | ||
* localeFallback | ||
* 0 | ||
* 1 | ||
* definitions | ||
* name | ||
* address | ||
* company | ||
* lorem | ||
* hacker | ||
* phone_number | ||
* finance | ||
* internet | ||
## Tests | ||
npm install . | ||
make test | ||
npm install . | ||
make test | ||
You can view a code coverage report generated in coverage/lcov-report/index.html. | ||
@@ -58,13 +223,13 @@ | ||
####Matthew Bergman & Marak Squires | ||
#### Matthew Bergman & Marak Squires | ||
<br/> | ||
Copyright (c) 2014 Matthew Bergman & Marak Squires http://github.com/marak/faker.js/ | ||
<br/> | ||
faker.js - Copyright (c) 2014-2015 | ||
Matthew Bergman & Marak Squires | ||
http://github.com/marak/faker.js/ | ||
faker.js was inspired by and has used data definitions from | ||
<br/> | ||
https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis <br/> | ||
http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles <br/> | ||
faker.js was inspired by and has used data definitions from: | ||
* https://github.com/stympy/faker/ - Copyright (c) 2007-2010 Benjamin Curtis | ||
* http://search.cpan.org/~jasonk/Data-Faker-0.07/ - Copyright 2004-2005 by Jason Kohles | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
@@ -77,6 +242,6 @@ a copy of this software and associated documentation files (the | ||
the following conditions: | ||
<br/> | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
<br/> | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
@@ -89,1 +254,3 @@ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
@@ -20,3 +20,3 @@ if (typeof module !== 'undefined') { | ||
var options = { max: 10 }; | ||
assert.ok(faker.random.number(options) < options.max); | ||
assert.ok(faker.random.number(options) <= options.max); | ||
}); | ||
@@ -23,0 +23,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3770531
91
145965
253