Skip to content

Commit c620e7a

Browse files
committed
chore: update readme
1 parent b150a7c commit c620e7a

File tree

1 file changed

+52
-46
lines changed

1 file changed

+52
-46
lines changed

README.md

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<div align="center">
32
<img src="./docs/public/logo.svg" width="200"/>
43
<h1>Faker</h1>
@@ -69,27 +68,27 @@ declare module '@faker-js/faker' {
6968

7069
An in-depth overview of the API methods is available in the documentation. The API covers the following modules:
7170

72-
| Module | Example | Output |
73-
|---------- |-------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
74-
| Address | `faker.address.city()` | Lake Raoulfort |
75-
| Animal | `faker.animal.type()` | Dog, cat, snake, bear, lion, etc. |
76-
| Commerce | `faker.commerce.product()` | Polo t-shirt |
77-
| Company | `faker.company.companyName()` | Zboncak and Sons |
78-
| Database | `faker.database.engine()` | MyISAM |
79-
| Datatype | `faker.datatype.uuid()` | 1oijf8-3iuhiu-21jddj-1092jf |
80-
| Date | `faker.date.past()` | Sat Oct 20 2018 04:19:38 GMT-0700 (Pacific Daylight Time) |
81-
| Finance | `faker.finance.amount()` | ¥23400 (After setting locale) |
82-
| Git | `faker.git.commitMessage()` | feat: add products list page |
83-
| Hacker | `faker.hacker.phrase()` | Try to reboot the SQL bus, maybe it will bypass the virtual application! |
84-
| Helpers | `faker.helpers.userCard()` | `{ avatar: ‘...’, email: ‘{ first }{ last }{ number }@{domain}’, first: '...' }`<br/><br/>All of the values are self-consistent (e.g. same first + last name in the email, too) |
85-
| Image | `faker.image.avatar()` | `https://s3.amazonaws.com/uifaces/faces/twitter/martip07/128.jpg` <img src=“https://s3.amazonaws.com/uifaces/faces/twitter/martip07/128.jpg” width=“64”/> |
86-
| Internet | `faker.internet.color()` | #630c7b |
87-
| Lorem | `faker.lorem.paragraph()` | Word, words, sentences, slug (lorem-ipsum), paragraph(s), text, lines |
88-
| Music | `faker.music.genre()` | R&B |
89-
| Name | `faker.name.firstName()` | Cameron |
90-
| Phone | `faker.phone.phoneNumber()` | +1 291-299-0192 |
91-
| System | `faker.system.directoryPath()` | C:\Documents\Newsletters\ |
92-
| Vehicle | `faker.vehicle.vehicle()` | 2011 Dodge Caravan
71+
| Module | Example | Output |
72+
| -------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
73+
| Address | `faker.address.city()` | Lake Raoulfort |
74+
| Animal | `faker.animal.type()` | Dog, cat, snake, bear, lion, etc. |
75+
| Commerce | `faker.commerce.product()` | Polo t-shirt |
76+
| Company | `faker.company.companyName()` | Zboncak and Sons |
77+
| Database | `faker.database.engine()` | MyISAM |
78+
| Datatype | `faker.datatype.uuid()` | 1oijf8-3iuhiu-21jddj-1092jf |
79+
| Date | `faker.date.past()` | Sat Oct 20 2018 04:19:38 GMT-0700 (Pacific Daylight Time) |
80+
| Finance | `faker.finance.amount()` | ¥23400 (After setting locale) |
81+
| Git | `faker.git.commitMessage()` | feat: add products list page |
82+
| Hacker | `faker.hacker.phrase()` | Try to reboot the SQL bus, maybe it will bypass the virtual application! |
83+
| Helpers | `faker.helpers.userCard()` | `{ avatar: ‘...’, email: ‘{ first }{ last }{ number }@{domain}’, first: '...' }`<br/><br/>All of the values are self-consistent (e.g. same first + last name in the email, too) |
84+
| Image | `faker.image.avatar()` | `https://s3.amazonaws.com/uifaces/faces/twitter/martip07/128.jpg` <img src=“https://s3.amazonaws.com/uifaces/faces/twitter/martip07/128.jpg” width=“64”/> |
85+
| Internet | `faker.internet.color()` | #630c7b |
86+
| Lorem | `faker.lorem.paragraph()` | Word, words, sentences, slug (lorem-ipsum), paragraph(s), text, lines |
87+
| Music | `faker.music.genre()` | R&B |
88+
| Name | `faker.name.firstName()` | Cameron |
89+
| Phone | `faker.phone.phoneNumber()` | +1 291-299-0192 |
90+
| System | `faker.system.directoryPath()` | C:\Documents\Newsletters\ |
91+
| Vehicle | `faker.vehicle.vehicle()` | 2011 Dodge Caravan |
9392

9493
### API Methods
9594

@@ -252,20 +251,20 @@ Faker provides many useful utility functions.
252251

253252
- faker.helpers
254253

255-
| API | Description |
256-
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
257-
| randomize | Get a random element from an array |
258-
| slugify | Removes unwanted characters from URI string |
259-
| replaceSymbolWithNumber | Parses string for a symbol and replace it with a random number from 1-10 |
260-
| replaceSymbols | Parses string for symbols (numbers or letters) and replaces them appropriately (# will be replaced with number, ? with letter and \* will be replaced with number or letter) |
261-
| replaceCreditCardSymbols | Replace symbols in a credit card schems including Luhn checksum |
262-
| repeatString | String repeat helper, alternative to String.prototype.repeat |
263-
| shuffle | Takes an array and randomizes it in place then returns it uses the modern version of the Fisher–Yates algorithm |
264-
| mustache | Generates a string with mustache {{ }} |
265-
| createCard | Generates a human card |
266-
| contextualCard | Generates a human contextual card |
267-
| userCard | Generates a website user card |
268-
| createTransaction | Generates a transaction |
254+
| API | Description |
255+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
256+
| randomize | Get a random element from an array |
257+
| slugify | Removes unwanted characters from URI string |
258+
| replaceSymbolWithNumber | Parses string for a symbol and replace it with a random number from 1-10 |
259+
| replaceSymbols | Parses string for symbols (numbers or letters) and replaces them appropriately (# will be replaced with number, ? with letter and \* will be replaced with number or letter) |
260+
| replaceCreditCardSymbols | Replace symbols in a credit card schems including Luhn checksum |
261+
| repeatString | String repeat helper, alternative to String.prototype.repeat |
262+
| shuffle | Takes an array and randomizes it in place then returns it uses the modern version of the Fisher–Yates algorithm |
263+
| mustache | Generates a string with mustache {{ }} |
264+
| createCard | Generates a human card |
265+
| contextualCard | Generates a human contextual card |
266+
| userCard | Generates a website user card |
267+
| createTransaction | Generates a transaction |
269268

270269
- faker.image
271270

@@ -468,37 +467,43 @@ Faker uses [gulp](http://gulpjs.com/) to automate its build process. Each build
468467
### Browser Bundle
469468

470469
```shell
471-
npm run browser
470+
pnpm install
471+
pnpm run build
472+
pnpm run browser
472473
```
473474

474475
### Testing
475476

476477
```shell
477-
npm install
478-
npm run test
478+
pnpm install
479+
pnpm run build
480+
481+
pnpm run test
482+
# or
483+
pnpm run coverage
479484
```
480485

481-
You can view a code coverage report generated in coverage/lcov-report/index.html.
486+
You can view a code coverage report generated in `coverage/index.html`.
482487

483488
### Developing the docs
484489

485490
```shell
486491
# build the Faker library for the browser
487492
# it's used inside of certain routes
488-
npm run browser
493+
pnpm run browser
489494

490-
npm run docs:dev
495+
pnpm run docs:dev
491496
```
492497

493498
### Building and serving the docs statically
494499

495500
```shell
496501
# build the Faker library for the browser
497502
# it's used inside of certain routes
498-
npm run browser
503+
pnpm run browser
499504

500-
npm run docs:build # Output docs to /dist
501-
npm run docs:serve # Serve docs from /dist
505+
pnpm run docs:build # Output docs to /dist
506+
pnpm run docs:serve # Serve docs from /dist
502507
```
503508

504509
### Deploying Documentation
@@ -510,8 +515,9 @@ The website is kindly hosted for free by the Netlify team under their Open Sourc
510515
[JSDOC](https://jsdoc.app/) v3 HTML API documentation
511516

512517
```shell
513-
npm run jsdoc
518+
pnpm run jsdoc
514519
```
515520

516521
## What happened to the original faker.js?
522+
517523
Read the [team update](https://fakerjs.dev/update.html) (January 14th, 2022).

0 commit comments

Comments
 (0)