Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

faker-datastore

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faker-datastore

thin wrapper of Faker module to simulate a datastore

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 08 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc