Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    faker-datastorepublic

    faker-datastore

    thin wrapper of faker module to simulate a datastore with consistent results

    To use it:

    const FakeDataStore = require('faker-datastore');
    const ds = new FakeDataStore(100);
    ds.getSize(); // 100
    ds.get(-1); // null
    ds.get(100); // null
    ds.get(13); // consistently fetches the same piece of data simulating a datastore

    The datastore hosts Person objects according to the following types:

    class Address {
        constructor(usState, city, streetName, streetAddress) {
            this.usState       = usState;
            this.city          = city;
            this.streetName    = streetName;
            this.streetAddress = streetAddress;
        }
    }
     
     
    class Person {
        constructor(fname, lname, email, dateOfBirth, address) {
            this.fname       = fname;
            this.lname       = lname;
            this.email       = email;
            this.dateOfBirth = dateOfBirth; // this is an actual Date object
            this.address     = address;
        }
    }

    Tests

    // not yet implemented
    

    Contributing

    Release History

    • 0.1.0     Initial release
    • 0.1.1     fixed sizing bug
    • 2.0.0     dateOfBirth is now an actual Date object

    install

    npm i faker-datastore

    Downloadsweekly downloads

    1

    version

    2.0.0

    license

    ISC

    repository

    githubgithub

    last publish

    collaborators

    • avatar