@mobilabs/scripto
v1.0.0
Published
A boilerplate to create a Node.js script
Downloads
4
Readme
README
This project is a template for creating a Node.js script.
Quick Startup
You can easily get your first Node.js script by simply adding a package.json file to your empty project folder and filling it with the following lines:
{
"name": "NameOfYourProject",
"scripts": {
"create": "npm install @mobilabs/scripto && npm run populate",
"populate": "scripto populate --name $npm_package_name --author $npm_package_config_name --acronym $npm_package_config_acronym --email $npm_package_config_email --url $npm_package_config_url && npm install"
},
"config": {
"name": "John Doe",
"acronym": "jdo",
"email": "[email protected]",
"url": "http://www.johndoe.com/"
}
}
Replace NameOfYourProject by your project name and fill config with your credentials.
And finally, type in the terminal:
npm run create.
That's almost all! When the script has been executed, your folder contains the following files:
Your project Folder
|_ scripts
| |_ ... // The scripts to build your project,
|_ src
| |_ main // The contents of our script(s),
|
|_ .eslintignore // Files to be ignored by ESLint,
|_ .eslintrc // A Configuration file for the ESLint linter tool (if you use it),
|_ .gitignore // Files that Git must ignore (if you use git),
|_ .npmignore // Files that are ignored by npm publish,
|_ .CHANGELOG.md // The changes between your different versions,
|_ LICENSE.md // The license that applies to your library (here MIT),
|_ main.js // The Node.js script,
|_ package-lock.json // The NPM dependency tree,
|_ package.json // The NPM package file,
|_ README.md // Your README file,
This folder is now a NPM package.
Run
Your script is ready to run!
To get the help, type:
node main.js --help
To execute a command, type:
# parse command:
node main.js xxx -x myarguments
That's all!
License
MIT.
-- oOo --