-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
286 changed files
with
3,480 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# Faker-CLI | ||
|
||
A CLI of [@faker-js/faker](https://github.com/faker-js/faker). | ||
A CLI of [@faker-js/faker](https://github.com/faker-js/faker). | ||
|
||
> **Note**: This is currently a [MVP](https://en.wikipedia.org/wiki/Minimum_viable_product). | ||
## Install | ||
|
||
```bash | ||
npm install --save-dev @faker-js/cli | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
faker module_name method_name | ||
``` | ||
|
||
Faker-CLI expects a `module_name` as well as a `method_name` depending on the module chosen. | ||
|
||
To list all possible modules run: | ||
|
||
```bash | ||
faker --help | ||
``` | ||
|
||
To list all possible methods of a module run: | ||
|
||
```bash | ||
faker module_name --help | ||
``` | ||
|
||
## Whats next | ||
|
||
Upcoming features might include: | ||
|
||
- localization | ||
- support for all parameters `@faker-js/faker` natively | ||
- make the CLI consumable for your own modules |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('../dist/src/index.js').cli(process.argv); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('aircraftType') | ||
.description(`Generates a random aircraft type.`) | ||
.action(() => { | ||
console.log(faker.airline.aircraftType()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('airline') | ||
.description(`Generates a random airline.`) | ||
.action(() => { | ||
console.log(faker.airline.airline()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('airplane') | ||
.description(`Generates a random airplane.`) | ||
.action(() => { | ||
console.log(faker.airline.airplane()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('airport') | ||
.description(`Generates a random airport.`) | ||
.action(() => { | ||
console.log(faker.airline.airport()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('flightNumber') | ||
.description(`Generates a random flight number.`) | ||
.action(() => { | ||
console.log(faker.airline.flightNumber()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Command } from 'commander'; | ||
import airportCommand from './airport'; | ||
import airlineCommand from './airline'; | ||
import airplaneCommand from './airplane'; | ||
import recordLocatorCommand from './recordLocator'; | ||
import seatCommand from './seat'; | ||
import aircraftTypeCommand from './aircraftType'; | ||
import flightNumberCommand from './flightNumber'; | ||
|
||
const command = new Command('airline') | ||
.description(`Module to generate airline and airport related data.`) | ||
.addCommand(airportCommand) | ||
.addCommand(airlineCommand) | ||
.addCommand(airplaneCommand) | ||
.addCommand(recordLocatorCommand) | ||
.addCommand(seatCommand) | ||
.addCommand(aircraftTypeCommand) | ||
.addCommand(flightNumberCommand); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('recordLocator') | ||
.description(`Generates a random record locator.`) | ||
.action(() => { | ||
console.log(faker.airline.recordLocator()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('seat') | ||
.description(`Generates a random seat.`) | ||
.action(() => { | ||
console.log(faker.airline.seat()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('bear') | ||
.description(`Generates a random bear species.`) | ||
.action(() => { | ||
console.log(faker.animal.bear()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('bird') | ||
.description(`Generates a random bird species.`) | ||
.action(() => { | ||
console.log(faker.animal.bird()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('cat') | ||
.description(`Generates a random cat breed.`) | ||
.action(() => { | ||
console.log(faker.animal.cat()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('cetacean') | ||
.description(`Generates a random cetacean species.`) | ||
.action(() => { | ||
console.log(faker.animal.cetacean()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('cow') | ||
.description(`Generates a random cow species.`) | ||
.action(() => { | ||
console.log(faker.animal.cow()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('crocodilia') | ||
.description(`Generates a random crocodilian species.`) | ||
.action(() => { | ||
console.log(faker.animal.crocodilia()); | ||
}); | ||
|
||
export default command; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Command } from 'commander'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
const command = new Command('dog') | ||
.description(`Generates a random dog breed.`) | ||
.action(() => { | ||
console.log(faker.animal.dog()); | ||
}); | ||
|
||
export default command; |
Oops, something went wrong.