├── .gitattributes ├── .github ├── FUNDING.yml ├── workflows │ └── ci.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── COMMIT_CONVENTION.md └── CODE_OF_CONDUCT.md ├── faker.png ├── .gitignore ├── .editorconfig ├── LICENSE ├── index.test-d.ts ├── README.md ├── package.json ├── CHANGELOG.md ├── index.d.ts ├── test.js └── index.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://awilum.github.io/sponsors'] 2 | -------------------------------------------------------------------------------- /faker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/faker-javascript/faker/HEAD/faker.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Global 2 | node_modules/ 3 | coverage 4 | package-lock.json 5 | 6 | # OS Generated 7 | .DS_Store* 8 | ehthumbs.db 9 | Icon? 10 | Thumbs.db 11 | *.swp 12 | 13 | # phpstorm 14 | .idea/* 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | 9 | [*.{js,d.ts,ts}] 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | indent_style = space 13 | indent_size = 4 14 | 15 | [package.json,*.yaml] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: ['push', 'pull_request'] 3 | jobs: 4 | test: 5 | name: Node.js ${{ matrix.node-version }} 6 | runs-on: ubuntu-latest 7 | strategy: 8 | fail-fast: false 9 | matrix: 10 | node-version: [^12, ^14, ^16, ^17] 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions/setup-node@v2 14 | with: 15 | node-version: ${{ matrix.node-version }} 16 | - run: npm install 17 | - run: npm test 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sergey Romanenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /index.test-d.ts: -------------------------------------------------------------------------------- 1 | import {expectType} from 'tsd'; 2 | import faker from './index.js'; 3 | 4 | expectType(faker().boolean()); 5 | expectType(faker().age()); 6 | expectType(faker().animal()); 7 | expectType(faker().gender()); 8 | expectType(faker().string()); 9 | expectType(faker().letter()); 10 | expectType(faker().profession()); 11 | expectType(faker().ip()); 12 | expectType(faker().superhero()); 13 | expectType(faker().integer()); 14 | expectType(faker().float()); 15 | expectType(faker().word()); 16 | expectType(faker().sentence()); 17 | expectType(faker().paragraph()); 18 | expectType(faker().domain()); 19 | expectType(faker().url()); 20 | expectType(faker().tld()); 21 | expectType(faker().browser()); 22 | expectType(faker().email()); 23 | expectType(faker().firstName()); 24 | expectType(faker().lastName()); 25 | expectType(faker().game()); 26 | expectType(faker().house()); 27 | expectType(faker().sport()); 28 | expectType(faker().blood()); 29 | expectType(faker().computer()); 30 | expectType(faker().camera()); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Faker 2 | 3 |
4 | 5 |

6 | A set of javascript packages that generates fake data for you. 7 |

8 | 9 |

10 | Version node-current License 11 |

12 | 13 | ## Install 14 | 15 | #### Install all faker packages. 16 | 17 | npm 18 | ``` 19 | npm install @fakerjs/faker --save-dev 20 | ``` 21 | 22 | yarn 23 | ``` 24 | yarn add @fakerjs/faker -D 25 | ``` 26 | 27 | ## Usage 28 | 29 | ```js 30 | import faker from '@fakerjs/faker'; 31 | 32 | faker().animal(); 33 | //=> Snow Leopard 34 | 35 | faker().gender(); 36 | //=> Female 37 | 38 | faker().profession(); 39 | //=> Software Engineer 40 | 41 | // etc... 42 | ``` 43 | 44 | [Browse all faker javascript packages](https://github.com/faker-javascript) 45 | 46 | ## License 47 | [The MIT License (MIT)](https://github.com/faker-javascript/faker/blob/master/LICENSE) 48 | Copyright (c) [Sergey Romanenko](https://github.com/Awilum) 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@fakerjs/faker", 3 | "version": "3.0.0", 4 | "description": "A set of javascript packages that generates fake data for you.", 5 | "license": "MIT", 6 | "repository": "faker-javascript/faker", 7 | "author": { 8 | "name": "Sergey Romanenko", 9 | "email": "awilum@msn.com", 10 | "url": "https://github.com/Awilum" 11 | }, 12 | "type": "module", 13 | "exports": "./index.js", 14 | "engines": { 15 | "node": ">=12" 16 | }, 17 | "scripts": { 18 | "test": "c8 ava; xo --space 4; tsd;" 19 | }, 20 | "devDependencies": { 21 | "ava": "^4.0.0", 22 | "c8": "^7.11.0", 23 | "tsd": "^0.19.1", 24 | "xo": "^0.47.0" 25 | }, 26 | "files": [ 27 | "index.js", 28 | "index.d.ts" 29 | ], 30 | "keywords": [ 31 | "fakerjs", 32 | "faker", 33 | "fake", 34 | "random", 35 | "generator", 36 | "fake-generator", 37 | "fake-data", 38 | "fake-data-generator" 39 | ], 40 | "dependencies": { 41 | "@fakerjs/boolean": "^2", 42 | "@fakerjs/integer": "^2", 43 | "@fakerjs/animal": "^2", 44 | "@fakerjs/age": "^2", 45 | "@fakerjs/float": "^2", 46 | "@fakerjs/gender": "^2", 47 | "@fakerjs/ip": "^2", 48 | "@fakerjs/letter": "^2", 49 | "@fakerjs/string": "^2", 50 | "@fakerjs/profession": "^2", 51 | "@fakerjs/superhero": "^1", 52 | "@fakerjs/word": "^1", 53 | "@fakerjs/sentence": "^1", 54 | "@fakerjs/paragraph": "^1", 55 | "@fakerjs/domain": "^1", 56 | "@fakerjs/tld": "^1", 57 | "@fakerjs/browser": "^1", 58 | "@fakerjs/url": "^1", 59 | "@fakerjs/email": "^1", 60 | "@fakerjs/firstname": "^1", 61 | "@fakerjs/lastname": "^1", 62 | "@fakerjs/game": "^1", 63 | "@fakerjs/house": "^1", 64 | "@fakerjs/sport": "^1", 65 | "@fakerjs/blood": "^1", 66 | "@fakerjs/computer": "^1", 67 | "@fakerjs/camera": "^1" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # [3.0.0](https://github.com/faker-javascript/faker) (2022-01-31) 3 | * Added new package `game` to generate fake game value. 4 | * Added new package `house` to generate fake house value. 5 | * Added new package `sport` to generate fake house value. 6 | * Added new package `blood` to generate fake house value. 7 | 8 | ### BREAKING CHANGES 9 | 10 | * Use new `faker` function to access all faker packages methods instead of old `faker` object. 11 | 12 | 13 | # [2.8.0](https://github.com/faker-javascript/faker) (2022-01-23) 14 | * Added new method `tld` to generate fake tld value. 15 | * Added new method `browser` to generate fake browser value. 16 | * Added new method `url` to generate fake url value. 17 | 18 | 19 | # [2.7.0](https://github.com/faker-javascript/faker) (2022-01-19) 20 | * Added new method `firstname` to generate fake first name value. 21 | * Added new method `lastname` to generate fake last name value. 22 | 23 | 24 | # [2.6.0](https://github.com/faker-javascript/faker) (2022-01-18) 25 | * Added new method `email` to generate fake email value. 26 | * Added new method `domain` to generate fake domain value. 27 | 28 | 29 | # [2.5.0](https://github.com/faker-javascript/faker) (2022-01-17) 30 | * Added new method `paragraph` to generate fake paragraph value. 31 | 32 | 33 | # [2.4.0](https://github.com/faker-javascript/faker) (2022-01-15) 34 | * Added new method `sentence` to generate fake sentence value. 35 | 36 | 37 | # [2.3.1](https://github.com/faker-javascript/faker) (2022-01-15) 38 | * Typo updates. 39 | 40 | 41 | # [2.3.0](https://github.com/faker-javascript/faker) (2022-01-14) 42 | * Added new method `word` to generate fake word value. 43 | 44 | 45 | # [2.2.0](https://github.com/faker-javascript/faker) (2022-01-13) 46 | * Added xo, tsd, c8. 47 | * Improved tests. 48 | 49 | 50 | # [2.1.0](https://github.com/faker-javascript/faker) (2022-01-10) 51 | * Added new method `superhero` to generate fake superhero name value. 52 | 53 | 54 | # [2.0.1](https://github.com/faker-javascript/faker) (2022-01-10) 55 | * Fixed issue with missed options 56 | * GitHub docs updates. 57 | 58 | 59 | # [2.0.0](https://github.com/faker-javascript/faker) (2022-01-09) 60 | 61 | ### BREAKING CHANGES 62 | 63 | * All packages update to version ^2 64 | 65 | 66 | # [1.0.2](https://github.com/faker-javascript/faker) (2022-01-09) 67 | * Fixed packages 68 | 69 | 70 | # [1.0.1](https://github.com/faker-javascript/faker) (2022-01-09) 71 | * Fixed packages 72 | 73 | 74 | # [1.0.0](https://github.com/faker-javascript/faker) (2022-01-09) 75 | * Initial release 76 | -------------------------------------------------------------------------------- /.github/COMMIT_CONVENTION.md: -------------------------------------------------------------------------------- 1 | # Git Commit Message Convention 2 | We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. 3 | 4 | ## Commit Message Format 5 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special 6 | format that includes a **type**, a **scope** and a **subject**: 7 | 8 | ``` 9 | (): 10 | 11 | 12 | 13 |