Create a new node module: Difference between revisions

From Bitpost wiki
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
* pick a name that doesn't yet exist on [npm.org] just to be safe
== Basic local module ==
* Create a directory for the module and cd into it
* Initialize it
npx license mit > LICENSE # optional
npx covgen YOUR_EMAIL_ADDRESS # optional
npx gitignore node
npm init es6 -y
 
== Published module ==
 
* pick a name that doesn't yet exist on [https://www.npmjs.com/] just to be safe
* create a wiki page off of [[Projects#In_Progress|in-progress Projects]]
* create a wiki page off of [[Projects#In_Progress|in-progress Projects]]
* mkdir ~/development/websockets-tester
* mkdir ~/development/websockets-tester
Line 5: Line 15:
* cp -rp ~/development/scripts/node/mah-haus/* .
* cp -rp ~/development/scripts/node/mah-haus/* .
* subl index.js package.json # clean to use wst (our top-level command)
* subl index.js package.json # clean to use wst (our top-level command)
* mv sy-cmd.js wst-cmd.js && mv sync-utils.js wst-utils.js
* npm install --save ws # to install a local copy of any dependency under node_modules, and auto-add dependency to package.json
* npm install --save ws # to install a local copy of any dependency under node_modules, and auto-add dependency to package.json
* git init --shared && git add *.js package.json
* on bitpost:
** mkdir ~/development/websockets-tester.git && cd ~/development/websockets-tester.git
** git init --bare --shared
* git remote add origin bitpost.com:/home/m/development/websockets-tester.git
* git push origin master  ... (come back once git-sync is doing auto version creation!)
* code your ass off
* code your ass off
* if it gets good... and is useful to others... publish it!
* if it gets good... and is useful to others... publish it!

Latest revision as of 17:04, 2 March 2023

Basic local module

  • Create a directory for the module and cd into it
  • Initialize it
npx license mit > LICENSE # optional
npx covgen YOUR_EMAIL_ADDRESS # optional
npx gitignore node
npm init es6 -y

Published module

  • pick a name that doesn't yet exist on [1] just to be safe
  • create a wiki page off of in-progress Projects
  • mkdir ~/development/websockets-tester
  • cd ~/development/websockets-tester
  • cp -rp ~/development/scripts/node/mah-haus/* .
  • subl index.js package.json # clean to use wst (our top-level command)
  • mv sy-cmd.js wst-cmd.js && mv sync-utils.js wst-utils.js
  • npm install --save ws # to install a local copy of any dependency under node_modules, and auto-add dependency to package.json
  • git init --shared && git add *.js package.json
  • on bitpost:
    • mkdir ~/development/websockets-tester.git && cd ~/development/websockets-tester.git
    • git init --bare --shared
  • git remote add origin bitpost.com:/home/m/development/websockets-tester.git
  • git push origin master ... (come back once git-sync is doing auto version creation!)
  • code your ass off
  • if it gets good... and is useful to others... publish it!