Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fake identities generator for node.js (names, addresses, phones, IPs and others). Supports multiple languages.
JavaScript Makefile
Tag: 0.1.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
.gitignore
.jshintignore
.jshintrc
.ndocrc
.travis.yml
HISTORY.md
LICENSE
Makefile
README.md
index.js
package.json

README.md

Charlatan

Build Status

This is node.js port of ruby's Faker library, that generates fake identities for names, addresses, phone numbers, emails and others.

See API Documentation for details.

Installation

Install Charlatan from npm registry:

$ npm install charlatan

Usage

var Charlatan = require('charlatan');

var name    = Charlatan.Name.name();       // Joshua Lemke MD
var email   = Charlatan.Internet.email();  // glover_ii@voluptas.name
var company = Charlatan.Company.name();    // Wilkinson LLC

Locales

Different countries have different data formats. Charlatan support locales as solution of this problem.

Currently available locales are here, en is default.

var Charlatan = require('charlatan');
Charlatan.setLocale('en-us');
Charlatan.Name.name();

Also you can use your own locale in yaml, json or plain hash.

var Charlatan = require('charlatan');
Charlatan.addLocale(myLocaleName, myLocaleFile);
Charlatan.setLocale(myLocaleName);
Charlatan.Name.name();

Note: If phrase not found in current locale, charlatan tries to then fallback into to base language, and then to en. For example ru_RU -> ru -> en.

Credits

Author Eugene Shkuropat

Released under the MIT license. See LICENSE for details.

Something went wrong with that request. Please try again.