This is a tool that handles model creation within your Node project. When invoked, it'll create the model file and a database helper file containing commonly used operations (create, read, update and delete)
It can also link existing models using one of has-one, has-many and belongs-to-one relationships
Finally, it allows you to quickly setup multiple models using a mass-generate feature
node-construct was created to automate a lot of the repetitive stuff involved in model management, allowing you to focus more on creating your app and less of scaffolding your models
Models created using this library are Objection.js models. Migrations created are based on the Knex.js query builder
This library is meant to be a global module, so install using
yarn global add node-construct
or
npm install -g node-construct
Get started with node-construct using a comprehensive guide illustrating the library's potential by creating a functional API server using Express.js in mere minutes. Click here to get started
Testing is carried out using the Mocha test runner and the Chai assertion library. Tests are automatically run on Codeship before deploying to the public.
To run the tests manually, follow these steps:
- Clone the project from Github
- Run
yarn
,yarn install
ornpm install
to install the project dependencies - Run
yarn test
ornpm test
During testing, the root folder is testing-area/
. All generated files are stored here for your
perusal
If you'd like this library and would like to support the author, you can do so by becoming a patreon at Patreon. It would also be really helpful if you can star the project at Github