fake.js

1.0.2 • Public • Published

Fakejs

FakeJS is a module based on Chance to generate Data Model (Random) at runtime.

Quick Examples

The model to create:

 
var child = {
    id : 'hash',
    name : 'first',
    age : 'age',
    email : 'email',
    birthday : 'birthday',
 
    id : function(){
        return 'US ' + Math.ceil(Math.random() * 1000);
    },
 
    fatherName: 'John Doe'
};

Using Fake.js

var fake = require('fake');
fake.create(child, 2, function(data){
    console.log(data);
});
 

The result :

 
[ 
    { 
        id: 'US 736',
        name: 'Erick',
        age: 2,
        email: 'leluzib@uta.gov',
        birthday: Sun Jul 26 1942 00:00:00 GMT-0300 (BRT),
        fatherName: 'John Doe' 
    },
  { 
        id: 'US 760',
        name: 'Gabriel',
        age: 76,
        email: 'wu@ubjurhan.org',
        birthday: Tue May 05 1953 00:00:00 GMT-0300 (BRT),
        fatherName: 'John Doe' 
    } 
]
 
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    3
  • 1.0.1
    2
  • 1.0.0
    2

Package Sidebar

Install

npm i fake.js

Weekly Downloads

4

Version

1.0.2

License

none

Last publish

Collaborators

  • wemersonblend