Slide 1

Slide 1 text

Hidden gems in npm Robert Kowalski @robinson_k ! ! FOSDEM 2014 - JavaScript devroom

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

marc falardeau - http://www.flickr.com/photos/49889874@N05/4772680734/

Slide 5

Slide 5 text

npm grows 0 15000 30000 45000 60000 2010 2011 2012 2013 Package count Sources: Isaac Schlueter: „How npm Works“, nodeconf 2011 and 
 http://www.modulecounts.com/

Slide 6

Slide 6 text

npm Inc. “…everything currently free will remain free…“ - @izs Source: http://blog.nodejs.org/2014/01/15/the-next-phase-of-node-js/

Slide 7

Slide 7 text

Community news from an awesome community

Slide 8

Slide 8 text

npmd provides offline search offline publishing with queueing full caching of installed modules

Slide 9

Slide 9 text

npmd syncs the package metadata of the registry into a LevelDB

Slide 10

Slide 10 text

European npm mirror Instructions: http://npmjs.eu/

Slide 11

Slide 11 text

Behind the scenes of npm

Slide 12

Slide 12 text

CDN Support +-------+ | | |CouchDB| | | +--+----+ | ^ | | | | | | | | | | v | +----+--+ | | |npm-cli| | | +-------+

Slide 13

Slide 13 text

CDN Support CDN for the tarballs of the registry (which contain the code of your modules) Origin for the CDN is a Manta service

Slide 14

Slide 14 text

CDN Support (json) +-------------------------------------+ | | | | | | v + +-------+ +-------+ +-------+ | | job | | (tgz) | | |CouchDB|+-------->| Manta |<--------+| CDN | | | | | | | +-------+ +-------+ +-------+
 





 origin

Slide 15

Slide 15 text

CDN Support $ npm install express! before CDN: 25.677s with CDN: 4.428s 5.7x EU-Mirror: 2.652s 9.6x

Slide 16

Slide 16 text

Manta /isaacs/public/npm Run computing jobs on it

Slide 17

Slide 17 text

Manta npm install -g manta! mfind /isaacs/public/npm/ # list of all packages

Slide 18

Slide 18 text

Examples for Computing Find out which of your module APIs are deprecated Security Audits on the whole registry (https://nodesecurity.io/)

Slide 19

Slide 19 text

npm New handy features

Slide 20

Slide 20 text

Juriën Minke - http://www.flickr.com/photos/jeminke/7009161635/ fast development

Slide 21

Slide 21 text

npm init Demo!

Slide 22

Slide 22 text

npm init - hidden gem $ npm config set init-module $YOUR_PATH_TO_THE_TEMPLATE! Example template: 
 https://github.com/isaacs/promzard/blob/master/example/substack-input.js

Slide 23

Slide 23 text

npm init module.exports = {! "name" : basename,! "version" : "0.0.0",! "description" : prompt("description", "fosdem"),! "license" : "MIT"! }

Slide 24

Slide 24 text

npm repo

Slide 25

Slide 25 text

{! "name": "fosdem",! "license": "BSD",! "version": "1.0.0",! "author": "Robert Kowalski ",! "description": "Hamburg JavaScript Meetup",! "main": "index.js",! "scripts": {! "test": "mocha -R spec"! },! "devDependencies": {! "mocha": "~2.1.4"! },! "repository": {! "type": "git",! "url": "git://github.com/robertkowalski/fosdem"! }! }!

Slide 26

Slide 26 text

Boring github urls "repository": {! "type": "git",! "url": "git://github.com/robertkowalski/fosdem"! }

Slide 27

Slide 27 text

shorthand style to the rescue! "repository": {! "type": "git",! "url": "robertkowalski/fosdem"! }

Slide 28

Slide 28 text

Your homepage is the github page? {! "homepage": "http://github.com/robertkowalski/fosdem",! "repository": {! "type": "git",! "url": "git://github.com/robertkowalski/fosdem"! }! }!

Slide 29

Slide 29 text

just keep it off "repository": {! "type": "git",! "url": "robertkowalski/fosdem"! }

Slide 30

Slide 30 text

outdated update "dependencies": {! "npm": "~1.2.32"! }

Slide 31

Slide 31 text

outdated update "dependencies": {! "npm": "~1.2.32"! }

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

better search output trimmed now, use --long for full, long output

Slide 35

Slide 35 text

Why am I telling you this?

Slide 36

Slide 36 text

Christian Zielecki - http://www.flickr.com/photos/zanthia/4085389085 stranded?

Slide 37

Slide 37 text

developing npm git clone https://github.com/npm/npm.git! cd npm! npm install && npm link

Slide 38

Slide 38 text

Q & A

Slide 39

Slide 39 text

Thanks! Robert Kowalski [email protected] - @robinson_k