diff options
| author | Tomasz Ducin <[email protected]> | 2015-05-10 20:13:26 +0200 |
|---|---|---|
| committer | Tomasz Ducin <[email protected]> | 2015-05-10 20:13:26 +0200 |
| commit | 55c729b32dfbd86faa3f0ea3a6698288dd15f303 (patch) | |
| tree | c778094ae9c568e6ec7f2b842d478c0539e4d845 | |
| parent | c0dc1c49a95c87cece7458c4099429fb7556de6a (diff) | |
| download | faker-55c729b32dfbd86faa3f0ea3a6698288dd15f303.tar.xz faker-55c729b32dfbd86faa3f0ea3a6698288dd15f303.zip | |
updated readme: sources and generated content #170
| -rw-r--r-- | MIT-LICENSE.txt | 13 | ||||
| -rw-r--r-- | Readme.md | 225 | ||||
| -rw-r--r-- | build/gulpfile.js | 13 | ||||
| -rw-r--r-- | build/src/docs.md | 72 |
4 files changed, 246 insertions, 77 deletions
diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index 0bf88e0e..ab1fbd53 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -1,12 +1,11 @@ -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 - - 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. +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 a copy of this software and associated documentation files (the @@ -1,38 +1,45 @@ # faker.js - generate massive amounts of fake data in the browser and node.js -<img src = "http://imgur.com/KiinQ.png" border = "0"> + + [](https://travis-ci.org/Marak/Faker.js) ## 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(); // [email protected] - 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(); // [email protected] + 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(); // [email protected] + var randomCard = faker.helpers.createCard(); // random contact card containing many properties - 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 +## Dependent tools -### CLI ( Command Line Tool ) +### Fake JSON Schema -see: https://github.com/lestoni/faker-cli +Use faker generators to populate JSON Schema samples. +See: https://github.com/pateketrueke/json-schema-faker/ -### Localization +### 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. @@ -48,26 +55,178 @@ Read further for complete list of locales. ## API -<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><li>uuid</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 + * email + * 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. ## Authors -####Matthew Bergman & Marak Squires +#### Matthew Bergman & Marak Squires + +faker.js - Copyright (c) 2014-2015 +Matthew Bergman & Marak Squires +http://github.com/marak/faker.js/ -<br/> -Copyright (c) 2014 Matthew Bergman & Marak Squires http://github.com/marak/faker.js/ -<br/> +faker.js was inspired by and has used data definitions from: -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/> + * 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 a copy of this software and associated documentation files (the @@ -76,10 +235,10 @@ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to 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, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -87,3 +246,5 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 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. + + diff --git a/build/gulpfile.js b/build/gulpfile.js index 9c933d53..3b5c5eb7 100644 --- a/build/gulpfile.js +++ b/build/gulpfile.js @@ -52,7 +52,6 @@ gulp.task('browser-package', function() { .pipe(gulp.dest('build/')) .pipe(gulp.dest('../examples/browser/js')) .pipe(rename('../examples/browser/js/faker.min.js')); - }); @@ -71,22 +70,18 @@ gulp.task('documentation', function(cb) { var faker = require('../index'); // 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>'; return gulp.src('./src/docs.md') .pipe(mustache({ 'API': API, - 'copyrightYear': new Date().getFullYear() + 'startYear': 2010, + 'currentYear': new Date().getFullYear() })) .pipe(rename("./Readme.md")) .pipe(gulp.dest('../')) diff --git a/build/src/docs.md b/build/src/docs.md index f8e9ca03..1b1e5941 100644 --- a/build/src/docs.md +++ b/build/src/docs.md @@ -1,34 +1,45 @@ # faker.js - generate massive amounts of fake data in the browser and node.js -<img src = "http://imgur.com/KiinQ.png" border = "0"> + + [](https://travis-ci.org/Marak/Faker.js) ## 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(); // [email protected] + 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(); // [email protected] - var randomCard = faker.helpers.createCard(); // random contact card containing many properties - </script> +### Node.js -### node.js - + var faker = require('./faker'); -### usage + 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 - var faker = require('./faker'); +## Dependent tools - 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 +### 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 +## Localization As of version `v2.0.0` faker.js supports 27 different language definition packs. @@ -47,23 +58,24 @@ Read further for complete list of locales. {{{API}}} ## Tests - npm install . - make test + + npm install . + make test You can view a code coverage report generated in coverage/lcov-report/index.html. ## Authors -####Matthew Bergman & Marak Squires +#### Matthew Bergman & Marak Squires + +faker.js - Copyright (c) 2014-2015 +Matthew Bergman & Marak Squires +http://github.com/marak/faker.js/ -<br/> -Copyright (c) {{copyrightYear}} Matthew Bergman & Marak Squires http://github.com/marak/faker.js/ -<br/> +faker.js was inspired by and has used data definitions from: -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/> + * 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 a copy of this software and associated documentation files (the @@ -72,10 +84,10 @@ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to 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, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -83,3 +95,5 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 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. + + |
