-
Let's start by creating a project
npm helpmkdir random-wombat-facts; and cd random-wombat-factsnpm init- explain each line
vim index.js- generate basic list of facts (fact1, fact2, etc)
- console.log one of them
- search for
random arrayon npmjs.com- pick
random-item
- pick
npm info random-item- to take a look at the
random-itempackage
- to take a look at the
npm install random-item --save- compare with
package.jsonnpm i random-item -S
- compare with
package.json
- compare with
- use REPL to play with
random-item- update
index.jsto userandom-item
- update
- run it on the command line
- add start script to
package.jsonnpm startto use the start script
- add
standardnpm install standard --save-devnpm i standard -D- add
standardizerun scriptstandard- NOTE: DO NOT HAVE TO INSTALL STANDARD GLOBALLY
- run
npm run standardize - run
npm run standardize -- --fix
-
Now we want to create a module that will provide a list of wombat facts
- create new dir
wombat-facts - run
npm init --yes - start with
fact1, fact2, fact3 module.exportthemnpm link- go back to project,
npm link wombat-facts require("wombat-facts")- return to module, replace
fact1, fact2, fact3 - go back to project, run and show it actually works with real wombat facts
- remove link
npm unlink - update package.json to make module scoped
npm publish @rockbot/wombat-facts --access=public- add a README
npm version minor -m "adds a README"
git push; and git push --tagsnpm publishnpm unpublish- talk about versions, how to publish/unpublish
- discuss semver
- create new dir
Last active
January 25, 2017 18:16
-
-
Save rockbot/d62fbd256a12b54dac08c00b738e4158 to your computer and use it in GitHub Desktop.
Show Notes for live coding in WDU talk at jsconf.asia (26 Nov 2016) and Vienna MegaMeetup (25 Jan 2017)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment