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

sails-seed

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-seed

Simple data seeding for sails.js projects.

  • 0.2.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
122
decreased by-1.61%
Maintainers
1
Weekly downloads
 
Created
Source

SAILS-SEED Build Status


Installation

npm install sails-seed

Depending on you version of sails, sails-seed is treated differently On install, a config/seed.js is created. Here you will put your seeding data.

Sails 0.11

For Sails 0.11 and greater there is nothing further to do. Sails-seed runs as an installable hook.

Sails 0.10

For Sails 0.10 and previous, a file of api/hook/seed/index.js is created on installation. No further configuration is required, but this file is necessary for the data to seed.

Usage

Place your seeding data in the config/seed.js file. For exampe, for a Person model, your config/seed.js file might look like

module.exports.seed = {
  person: [
    {
      firstName: 'Luke',
      lastName:  'Skywalker'
    },
    {
      firstName: 'Darth',
      lastName:  'Vader'
    }
  ]
}

By default, sails-seed will overwrite the data which is present. If you would not like your seed to overwrite, your new config/seed.js file might look like

module.exports.seed = {
  person: {
    data: [
      {
        firstName: 'Luke',
        lastName:  'Skywalker'
      },
      {
        firstName: 'Darth',
        lastName:  'Vader'
      }
    ],
    overwrite: false
  }
}

Author

M. Elliot Frost, CEO of Frostware

Keywords

FAQs

Package last updated on 03 May 2015

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