sails-crud-generators
v2.0.0
Published
Custom Sails.js generators for automatic generation of db models, controllers, routes and unit tests
Downloads
12
Readme
sails-crud-generators
A set of custom generators for use with the Sails command-line interface.
Installation
$ npm install sails-crud-generators --save
Then merge the following into your .sailsrc
file:
{
"generators": {
"modules": {
"db:sync": "./node_modules/sails-crud-generators/src/generators/sails-generate-sequelize-sync",
"schema": "./node_modules/sails-crud-generators/src/generators/sails-generate-schema",
"controller": "./node_modules/sails-crud-generators/src/generators/sails-generate-crud-controller",
"route": "./node_modules/sails-crud-generators/src/generators/sails-generate-route",
"api": "./node_modules/sails-crud-generators/src/generators/sails-generate-api"
}
}
}
Certain generators are installed by default in Sails, but they can be overridden. Other generators add support for generating entirely new kinds of things. Check out Concepts > Extending Sails > Generators for information on installing generator overrides / custom generators and information on building your own generators.
Usage
$ sails generate db:sync
$ sails generate schema <schema-name> --types json,sql --fields field1,field2,field3,..
$ sails generate controller <schema-name> --type sql|mongo
$ sails generate route <schema-name>
$ sails generate api <schema-name> --type json|sql|mongo --fields field1,field2,field3,..
Need help?
See Extending Sails > Generators > Custom Generators in the Sails documentation, or check out recommended support options.
Contributing
Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.
License
This sequelize:sync generator is available under the MIT license.
The Sails framework is free and open-source under the MIT License.