1.0.0 • Published 2 years ago

digilocker-npm-module v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Publishing node module in openForge

commands to push

  1. init git
  2. set origin

Npm command

  1. npm init/ npm init -y (to init the npm and set package.json file)
  2. code the index or the main file of the project (index or the main file)
  3. run npm run build
  4. npm login
  5. npm whoami *check the id is correct or not
  6. npm publish

Note

I had used typescript hence:

  1. run npm i -D typescript in terminal after npm init
  2. add tsconfig.json file with configurations and :-

  3. in package.json

  • change *scripts* :-
    • add "build":"tsc" for typescript
    • add "prepare": "npm run build" to prepare the package file for publishing
  • add at the end "files" : "/lib/**/" *for pushing only the lib file that was build after npm build on the npm registery
    • or can create a new file .npmignore
  • add "types" : " .d.ts", it tells where the decleration file is
  • Note Don't forget to check the index,js file path