https://github.com/alanbsmith/contact-generator
a script for generating random contact data
https://github.com/alanbsmith/contact-generator
Last synced: 9 months ago
JSON representation
a script for generating random contact data
- Host: GitHub
- URL: https://github.com/alanbsmith/contact-generator
- Owner: alanbsmith
- Created: 2021-01-14T21:14:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-14T21:15:17.000Z (over 5 years ago)
- Last Synced: 2025-02-02T19:33:26.259Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contact Generator
## Up & Running
### Install Dependencies
```sh
npm install
```
### Generate Contacts
By default, this script will generate 1000 contacts and put it in `./data/contacts.csv`
```sh
node .
```
## Customization
There are a handful of things you can customize with this script:
- Contact Count `-c` or `-count`
- File Path `-path` or `-p`
- File Format `-format` or `-f`
- Contact Attributes `-attrs` or `-a`
### Contact Count
By default, this is set to 1000, but you can set it to any amount
```sh
node . -count=2000
# or
node . -c=2000
```
### File Path
By default, this is set to `./data/contacts.{fileFormat}`, but you can also provide a custom path. If a directory does not exist, the script will create it for you.
```sh
node . -path=data/json/contact-data
# or
node . -p=data/json/contact-data
```
### File Format
By default, this is set to `csv`, but you can also use `json`
```sh
node . -format=json
# or
node . -f=json
```
### - Contact Attributes
By default, `id`, `firstName`, `lastName`, and `email` attributes will be added to contacts, but you can provide any of the following:
- `id`
- `firstName`
- `lastName`
- `email`
- `city`
- `state`
- `zipCode`
```sh
node . -attrs={id,firstName,lastName,email,city,state,zipCode}
# or
node . -a={id,firstName,lastName,email,city,state,zipCode}
```