tiny-npm-deploy-hyl
v1.0.1
Published
## project setup
Downloads
1
Readme
deliver package to npm
project setup
in package.json: add "scripts": {"build": "tsc"} then run $ npm run build -> tsc will compile
use unique package name
in package.json: modify "name": "tiny-npm-deploy-hyl"
specify which files to publish
in package.json: add "files": ["dist"] (publish everything in "dist" directory)
split devDependencies and dependencies
in package.json: move "@types/express": "^4.17.12", to devDependencies
set package to be public
in package.json, add "publishConfig": { "access": "public" },
set file to be executed directly in terminal
in package.json, add "bin": "dist/index.js", then in src/index.ts, add on top: #!/usr/bin/env node
add 'prepublish' script
in package.json, add "scripts": {"prepublishOnly": "npm run build"} this will make it build before publish
commit to git
tiny-npm-deploy $ git init then create .gitignore file with: dist node_modules then check git status: $ git status, the proper files/folder to commit are: package-lock.json package.json src/ tsconfig.json then $ git add . then $ git commit -m "initial commit"
publish
log into npmjs.com: $ npm login $ npm publish