@alucic/shako v1.0.1
Shako - simple file generator
Installation
npm install @alucic/shako -gSimple usage to create timestamped file 20191104042110-add-users-table.js
shako add-users-tableGlobal Usage
shako <filename>
Options:
--help Show help [boolean]
--version Show version number [boolean]
-t, --timestamp Include timestamp in the filename [boolean] [default: true]
-p, --prefix Prefix filename [string] [default: ""]
-s, --suffix Suffix filename [string] [default: ""]
--template Template file [string] [default: ""]Examples:
Create a timestamped file within a directory migrations/20191104042110-add-users-table.js.
Also creates a directory if it doesn't exist.
shako migrations/add-users-tableCreate a file with a suffix - tests/payment/index_test.js
shako -t=false -s=_test tests/payment/indexCreate a file using a template - migrations/20191104042110-add-users-table.js
shako --template=migration-template.js migrations/add-users-table.jsPrefix is executed before timestamp modifier - 20191106023823-prefix-your-filename.js
shako -t=true -p=prefix your-filenameIf provided, shako will keep existing filename extension.
shako migrations/add-users-table.phpLocal usage
You can install shako per project and include helpers in package.json scripts.
npm install @alucic/shako --save-devAssuming you have your migration and test template set, you can add custom scripts that use shako.
"scripts": {
"start": "node app",
"make:migration": "shako --template=migrations/migration-template.js migrations/",
"make:test": "shako -t=false --template=tests/test-template.js -s=_test tests/"
},npm run make:test payment/processor.js
Generates test/payment/processor_test.js file with contents from tests/test-template.js file.
npm run make:migration add-users-table
Generates migrations/20191106023823-add-users-table.js file with contents from migrations/migration-template.js file.
Contributing
npm test