+ - 0:00:00
Notes for current slide
Notes for next slide

you don't know

npm logo

1 / 78

http://bit.ly/node-live

(gh-pages: ashleygwilliams/node-live)

2 / 78

node-together-boston

3 / 78

NodeTogether

require('all');
4 / 78

tech has a diversity problem

5 / 78

Node has a diversity problem

6 / 78

another Node is possible

7 / 78

node-together-london

8 / 78

LA

9 / 78

bangalore

10 / 78

paris

11 / 78

we need your help

12 / 78

NodeTogether

http://www.nodetogether.org

@node_together

13 / 78

you don't know

npm logo

14 / 78

everyday around 1,800,000 install events occur.

15 / 78

each install is around 70 packages.

16 / 78

1,800,000 * 70

17 / 78

126,000,000

18 / 78

that's a lot of packages

19 / 78

hi my name is @ag_dubs

space invader ghost dolphin

20 / 78

jeans scissors cool

escalator

21 / 78

developer community and content manager

22 / 78

?????lolwat

confused malmutes

23 / 78

if you don't understand how npm works

fire fire fire

24 / 78

that's my problem

grimacing

25 / 78

my job is to make sense

money

26 / 78

biggest day

27 / 78

more than 1.2 billion downloads over a week

28 / 78

one billion

29 / 78

numbers

30 / 78

module counts

source: http://modulecounts.com, accessed: 14 apr 2016

31 / 78

npm is the LARGEST PACKAGE MANAGER IN THE WORLD.

32 / 78

stuff everybody knows

npm install

33 / 78

stuff not everyone knows

i dont know

34 / 78

create a package.json

npm init

  • knows your deps from node_modules

  • knows your repository from git repo

  • always adds keys, never deletes

chick

35 / 78

create a package.json with defaults

npm init --yes

yes

36 / 78

customize npm init questions

~/.npm-init.js

enforce license and best practices

question art question

37 / 78

add deps from the CLI

npm i --save

npm i --save-dev

disk disk disk

38 / 78

add deps from the CLI

npm i -S

npm i -D

disk disk disk

39 / 78

just not connecting with npm3?

pup fail

40 / 78

show the dep tree

npm ls

list tree list

42 / 78

show just primary deps

npm ls --depth=0

list list list

43 / 78

npm... global cache?

.npm/

modules are stored in the home directory

... but you can't use this offline because it still hits the network

44 / 78

npm install offline

npm install --cache-min 999999

we should probably just alias this to:

npm install --offline

money money money

45 / 78

npm install offline

npm pack

npm install my-pkg.tgz

create a tarball out of any package and then use install directly on the tarball

shirt soon suitcase

46 / 78

pack your deps!

bundledDependencies

pack doesn't add your pkg's deps BUT

bundled deps are added to the tarball!

suitcase soon suitcase

47 / 78
  • dependencies juggling

  • devDependencies hammer wrench

  • optionalDependencies ghost

  • peerDependencies plug

48 / 78

lock down your deps

npm shrinkwrap

shrinkwrap

49 / 78

lock down your deps

npm shrinkwrap

  • deploy to production EXACTLY what you used in dev

  • locks every version of every package and all dependencies in node_modules

lock lock lock

50 / 78

update your shrinkwrap

--save and --save-dev

- don't need to shrinkwrap everytime

- new with npm3!

lock-pen new lock-pen

51 / 78

why not a default feature?

52 / 78

we believe in semver

want to believe

53 / 78

semver made easy

npm version <type>

types: major, minor, patch

  • major: breaking changes

  • minor: feature add

  • patch: bug fix, docs

54 / 78

automate all the things

npm run $anything

- test, start

- customize!

theater runner theater

55 / 78

lifecycle events

automation that is context aware

seedling plant tree

56 / 78

run scripts are composable!

score score score

57 / 78

get stuff for free

devDependencies are in path

config and package.json as variables

sparkles free sparkles

58 / 78

scoped packages

(fancy way of saying namespaced packages!)

59 / 78

scoped packages

npm i @scope/name

telescope

60 / 78

scoped packages

npm i @scope/name

telescope

scoped packages are private by default but you can make them public:

npm publish --access=public

61 / 78

npm private modules

lock

62 / 78

npm private modules

lock

(it's recursive! get it? get it?)

63 / 78

npm private modules

lock

(it's recursive! get it? get it?)

npmnpmnpmnpmnpmnpmlolololololol

64 / 78

private modules

npm init --scope=<usrname>

Use your private modules side by side with modules from the public registry

dancers

65 / 78

managing access is hard...

fail

66 / 78

npm organizations

npm team

  • create teams and add members

  • grant and revoke access to packages via scopes

team

67 / 78

npm on-site

run your own on-premises npm registry

npm login

--registry=http://reg.amazing.com

office runner

68 / 78

npme addons

69 / 78

you want more

insatiable

70 / 78

the npm CLI and Registry are for and by the community

lightbulb lightbulb lightbulb

71 / 78

npmstatus

75 / 78

the more you know

76 / 78

npm s you

77 / 78

thanks!

me => @ag_dubs

bit.ly/node-live

space invader ghost dolphin

78 / 78

http://bit.ly/node-live

(gh-pages: ashleygwilliams/node-live)

2 / 78
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow