for Enterprise developers

PayPal, 2017-07-20

Who is this guy?

Laurie Voss

COO of npm, Inc.

@seldo

What am I talking about?

Like laser robots

And space suits

at NASA

And actual satellites

But mostly websites

80% of npm users are using it to build websites

10 billion downloads per month

520,000 packages

8.4 million users

Everybody ❤️ npm

"Dang, that's fast"

- everyone

npm install -g npm

Why modules?

Small modules enable big apps

Modules can

be re-used

npm init

npm install

package-lock.json

SemVer

2.34.13

Breaking

Feature

Fix

major
minor
patch

Why SemVer?

SemVer is built into npm

~3.5.3

^3.5.3

Automatic SemVer makes your team more efficient

The bigger you are, the more it helps

Libraries

vs

Applications

Libraries want SemVer

Applications prefer stability

package-lock.json best practices

package-lock.json benefits

npm 5 uses new features of the registry

npm Enterprise

Authentication and access control

Replication

Security

Discovery

Collaboration

npx

You can tell it's cool because it has an X in the name!

run scripts

{
  "name": "@seldo/some-package",
  "version": "1.0.0",
  ...
  "scripts": {
    "test": "mocha ./test/*.js",
    "start": "node ./index.js"
  }
}

Why use run scripts?

Version controlled development environments

Lifecycle events

publish:   prepublish, publish, postpublish
install:   preinstall, install, postinstall
uninstall: preuninstall, uninstall, postuninstall
version:   preversion, version, postversion
test:      pretest, test, posttest
stop:      prestop, stop, poststop
start:     prestart, start, poststart
restart:   prerestart, restart, postrestart

Husky

npm install husky

Automating best practices

Automation is a gigantic time saver

So automate already

Run scripts use your dev dependencies

npm install --save-dev

Dev dependencies are in path for run scripts

Use npx to run your dev dependencies directly

npx jest

Use npx to run

one-off comands

npx create-react-app

Use npx to try out new tooling

npx webpack@3.3

Other npx features

What else is new

in npm 5?

npm for front-end development

webpack

babel

Webpack and babel have 1000s of plugins

Use linters to improve your

code reviews

Wrapping up

Think of some questions.

There's swag in it for you!

Tell your friends* about npm Enterprise

* especially if your friend is your manager

npm ❤️ you

The best way to reach me is Twitter:

@seldo

You can get these slides:

https://slides.com/seldo/npm-for-enterprise