clique-seeds
Install
yarn add clique-seeds
Overview
Use the Seeds()
constructor to instantiate a generator for creating seed data. The Seeds
constructor takes two optional arguments:
- instance<?number|?string>: See the Chance.js Seed documentation. The instance value essentially guarantees repeatable results given the same instance value and options arguments.
- options<?object>: See default options below.
Default options
Most of the following default options apply to the init()
method which generates a graph of relational data.
{
customerCount: 2,
maxFolderDepth: 6,
maxAssets: 30,
maxProjects: 10,
maxFolders: 10,
maxCollections: 10,
quiet: true,
}
NOTE: Modifying these options can exponentially increase the number of records generated
Usage
const Seeds = require('clique-seeds');
const seeds = new Seeds(1);
const asset = seeds.asset();
const folder = seeds.folder({ id: '123123' });
const customers = seeds.generate(10, this.customer)
seeds.init()
seeds.serialize('projects')
seeds.title()
seeds.companyName()
seeds.titleWord()
seeds.buzzWord()
seeds.randomCount(10, 100)
seeds.smallCount(10)
seeds.largeCount(10)
seeds.randomCount(10, 100)
seeds.useOnce(['foo', 'bar'], 'baz')
seeds.useOnce(['foo', 'bar'], 'baz')
seeds.useOnce(['foo', 'bar'], 'baz')
seeds.useOnce(['foo', 'bar'], 'baz')