Last active
February 21, 2022 14:08
-
-
Save diversemix/45b83aa0eebde140891ed5a0b9a2ce81 to your computer and use it in GitHub Desktop.
Create new node project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Takes one argument - the name of the package | |
# | |
mkdir $1 | |
cd $1 | |
npm init -y | |
echo 'console.log("hello");'>> index.js | |
cat package.json |jq --argjson scripts '{"start": "node ./index.js"}' '.scripts += $scripts' > new_package.json | |
cp package.json old_package.json | |
mv new_package.json package.json | |
npm i | |
npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment