NG-Faker
Usage
Installation
Install with npm:
npm install ng-faker --save-dev
Install with yarn:
yarn add ng-faker --dev
Browser
For now, we don't have support for the browser directly. We're working on that and should have that up really soon.
Node.js
var ngfaker = ; var randomName = ngfakername; // Annabelle var randomWord = ngfakerlorem; // Thanks so much.
API
ngfaker.fake()
ngfaker contains a super useful generator method ngfaker.fake for combining ngfaker API methods using a mustache string format.
Example
console;// outputs: "Dr. Annabelle Smith"
This will interpolate the format string with the value of methods name.prefix(), name.lastName() and name.firstName().
API Methods
- account
- bank
- accountNumber
- address
- state
- states
- localGovernment
- localGovernments
- lorem
- word
- phrase
- name
- firstName
- lastName
- prefix
- fullName
- phone
- phoneNumber
- serviceProvider
- fake
- random
- boolean
- number
- arrayElement
- objectElement
- alphanumeric
- hexadecimal
Localization
The default language locale is set to English.
Setting a new locale is simple:
var ngfaker = ;// sets locale to yo (Yoruba)ngfaker;// orngfakerlocale = "yo";
- yo - Yoruba
- en - English
- ha - hausa
- ig - igbo
- ek - Efik
- bn - Benin
- ur - urhobo
Other locales will be added soon...
Custom Locale
Adding a new locale is equally easy:
ngFaker
Tests
npm run test
Version Release Schedule
If you require the absolute latest version of ng-faker
the master
branch on the official repo should always be up to date and working.
Maintainers
- Bolaji Olajide
- Rotimi Babalola
- Oyindamola Subair
Contributors
Rotimi Babalola |
Bolaji Olajide |
Subair Oyindamola |
---|---|---|
Olamilekan Odukoya |
Ayomiga |
JCobhams |
:---: | :---: | :---: |
Seun Faluyi |
Neiva07 |
nero-adaware |
:---: | :---: | :---: |
sudo-kaizen |
ng-faker was inspired by and has used data definitions and logic from: