Skip to content

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

License

Notifications You must be signed in to change notification settings

wemersonblend/fakejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
  email : 'email',
  birthday : 'birthday',

  id : function(){
    return 'US ' + Math.ceil(Math.random() * 1000);
  },  

  fatherName: 'John Doe'
};

Using Fake.js

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

The result :

[ 
  { 
    "id": "US 736",
    "name": "Erick",
    "email": "[email protected]",
    "birthday": "Sun Jul 26 1942 00:00:00 GMT-0300 (BRT)",
    "fatherName": "John Doe" 
  },
  { 
    "id": "US 760",
    "name": "Gabriel",
    "email": "[email protected]",
    "birthday": "Tue May 05 1953 00:00:00 GMT-0300 (BRT)",
    "fatherName": "John Doe" 
  } 
]

Fakejs accepts most parameters Chance available, in addition to the default properties of the javascript as String, Integer, boolean, and functions

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published