1.0.0 • Published 4 years ago
npm-publish-training-app v1.0.0
Init NPM
npm init -y
git initFurther setup
npm i typescript express @types/express eslintInit TS
npx tsc --initConfigure project
tsconfig.ts
{ declaration: true, outDir: './dist' }package.json
Make sure name is not available at https://www.npmjs.com/
{
"name": "npm-publish-training-app",
"publishConfig": {
"access": "public"
},
"files": [
"./dist"
],
"bin": "./dist/index.js",
"scripts": {
"build": "tsc",
"prepublishOnly": "npm run build"
},
}#!/user/bin/env node - added to index.ts allows to execute directly instead of project/dist/node index.js
Split dependencies and devDependencies
Publish to NPM
npm login
npm publish1.0.0
4 years ago