Skip to content

Instantly share code, notes, and snippets.

@emmanuelnk
Last active January 18, 2019 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmanuelnk/3d577224b27241fdfc24bdf1c512944a to your computer and use it in GitHub Desktop.
Save emmanuelnk/3d577224b27241fdfc24bdf1c512944a to your computer and use it in GitHub Desktop.
# first install npx (https://github.com/zkat/npx)
npm install -g npx
# set your npm defaults if you havent already
npm set init.author.name "Your name"
npm set init.author.email "your@email.com"
npm set init.author.url "https://your-url.com"
npm set init.license "MIT"
npm set init.version "1.0.0"
# open bash profile to add following function
nano ~/.bash_profile
# copy into file
function node-project {
git init
npx license $(npm get init.license) -o "$(npm get init.author.name)" > LICENSE
npx gitignore node
npx covgen "$(npm get init.author.email)"
npm init -y
git add -A
git commit -m "Initial commit"
}
source ~/.bash_profile
# now, whenever you want to run a new node project, just execute:
node-project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment