Node Scaffold
Quick scaffolding on several frameworks!
Installation
$ npm install node-scaffold -g
Description
v0.1.3 Fixed format bug.
I'll add another more options later!
Working:
- ✓
Generate models - ✓
Generate controllers - ✓
Generate views - ✓
Generate application - ✓
Inflection working (in English)
Quick Usage
You will need to create a file to place your scaffold (shell also in future).
Here is a sample of this file:
scaffold.json
/* SAMPLE */
After that, you need to create a file where you want to scaffold:
scaffold.js
;
Now, just execute it!
$ node scaffold.js --file /path/to/scaffold.json
Remeber to install all dependencies!
$ sudo npm install
Now you just need to test your routes! In this example:
node app.js curl http://localhost:3000/usercurl http://localhost:3000/car
To see other usage options (very limited at the moment), just
$ node scaffold.js --help Usage: node xx.js [options argument] Options: -h, --http-framework name Http framework to use . -de, --db-engine name DB engine to use . -df, --db-framework name DB framework to use . -f, --file filepath File to read . -F, --force-overwrite Force overwrite of existing files. Example: node scaffold.js --file data.json Documentation can be found at http://github.com/mauriciogior/node-scaffold
Having problems?
If you have problems like "cannot find module 'node-scaffold'", probably your NODE_PATH is wrong!
In mac:
$ export NODE_PATH=/usr/local/lib/node_modules
In linux: you can handle it :)
TODO List
- Add relationships between models
- Use EJS for templating (intern)
- Accept other http frameworks (besides express)
- Accept other db engines (besides mongodb)
- Accept other db frameworks (besides mongoose)
- Accept other layout engine (besides jade)
- Allow shell scaffolding