Scaffold a Node.js module with Slush
This is what I use for my own modules.
$ npm install -g slush slush-node-module
Create a new folder for your project and
cd into it:
$ mkdir my-new-project && cd my-new-project
Run the generator and answer the questions.
$ slush node-module ? Module name: my-new-project ? Description: My super cool new project ? Keywords (comma-separated): project, cool, personal ? Your GitHub username: rafaelrinaldi ? URL of your website: http://rinaldi.io ? Will you need a CLI? No
After the installation it will install your
npm dependencies and you should be good to go.
An overview of the module and what it does.
Software license file which follows the MIT standard.
npm manifest file. Current settings are:
MITlicense by default.
>=0.10.0for regular modules and
>=4for CLI (so we can use ES2015 features).
Files that are hidden by default.
EditorConfig configuration file. This is used to enforce consistency between editors and IDEs.
Files and folders to be ignored by Git.
Simple Git configuration to ensure line endings are normalized across different operating systems.
When scaffolding a Node.js module that has a CLI interface:
./binwhich is described as a best practice by the CommonJS standard
cli.jsfile on the project root that will be the command line interface for the module
cli.jsfile will expose
parse()for better test integration (kudos @millermedeiros)
--help) and version number (triggered via
MIT ©️ Rafael Rinaldi