New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@superseed/core

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superseed/core

This is package contains core Classes and helpers for defining custom MockGenerators nad DataSources.

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
2
Weekly downloads
 
Created
Source

superseed core

This is package contains core Classes and helpers for defining custom MockGenerators nad DataSources.

Core classes

MockGenerator

The base Mock generator class to extend when defining custom generators.

Creating a custom mock generator

A mock generator must extend the MockGenerator and implement the generate() method. This method generate multiple mocks based on the cound. The Example:

const {MockGenerator} = require('@supoerseed/core');
 class CustomGenerator extends MockGenerator {
  generateMock(db, staticFields = {}) {
   // generate some mock data
  }
}
const myGenerator = new CustomGenerator();

A simpler way is

const myGenerator = new MockGenerator({
  generateMock(db, staticFields = {}) {
    // generate some mock data
  }
});

For more examples see @superseed/mongoose and @superseed/mocker-data-generator

DataSource

The Mock generator class to extend when defining custom data sources.

Creating a custom data source

Example:

class CustomSource extends DataSource {
    createSeeds(seeds){
       // save seed somewhere
    }
    
    deleteSeeds() {
      // delete seed created earlier 
    }
}
const myCustomSource = new CustomSource();

A simplified way

const myCustomSource = new DataSource({
  createSeeds(seeds) {
    // save seed somewhere
  },
  deleteSeeds() {
    // delete seed created earlier 
  }
});

For more examples see @superseed/mongodb and @superseed/restapi

Core generators

  • hasMany
  • hasOne

Keywords

FAQs

Package last updated on 15 Aug 2019

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