Hidden gems in npm

Hidden gems in npm

Node has one of the best package managers around: npm. With more than 50k packages the npm registry has an average growth of 116 packages/day and every month a lot of features are added to npm itself. In my talk I will show some brand new features and hidden gems to make you a more productive npm user.

Most of npm's features are unknown to most developers, but in fact they would make their life more productive.

In the beginning of my talk I am giving an intro on the history of npm and how npm works behind the scenes. I will show some brand new features and hidden gems to make the audience a more productive npm user and also show some really nice other projects from the node community related to npm which will also increase your productivity.

765845d4b1c07dd284eae0866d1d7939?s=128

Robert Kowalski

February 02, 2014
Tweet

Transcript

  1. Hidden gems in npm Robert Kowalski @robinson_k ! ! FOSDEM

    2014 - JavaScript devroom
  2. None
  3. None
  4. marc falardeau - http://www.flickr.com/photos/49889874@N05/4772680734/

  5. 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/
  6. npm Inc. “…everything currently free will remain free…“ - @izs

    Source: http://blog.nodejs.org/2014/01/15/the-next-phase-of-node-js/
  7. Community news from an awesome community

  8. npmd provides offline search offline publishing with queueing full caching

    of installed modules
  9. npmd syncs the package metadata of the registry into a

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

  11. Behind the scenes of npm

  12. CDN Support +-------+ | | |CouchDB| | | +--+----+ |

    ^ | | | | | | | | | | v | +----+--+ | | |npm-cli| | | +-------+
  13. CDN Support CDN for the tarballs of the registry (which

    contain the code of your modules) Origin for the CDN is a Manta service
  14. CDN Support (json) +-------------------------------------+ | | | | | |

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





 origin
  15. CDN Support $ npm install express! before CDN: 25.677s with

    CDN: 4.428s 5.7x EU-Mirror: 2.652s 9.6x
  16. Manta /isaacs/public/npm Run computing jobs on it

  17. Manta npm install -g manta! mfind /isaacs/public/npm/ # list of

    all packages
  18. Examples for Computing Find out which of your module APIs

    are deprecated Security Audits on the whole registry (https://nodesecurity.io/)
  19. npm New handy features

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

  21. npm init Demo!

  22. 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
  23. npm init module.exports = {! "name" : basename,! "version" :

    "0.0.0",! "description" : prompt("description", "fosdem"),! "license" : "MIT"! }
  24. npm repo

  25. {! "name": "fosdem",! "license": "BSD",! "version": "1.0.0",! "author": "Robert Kowalski

    <rok@kowalski.gd>",! "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"! }! }!
  26. Boring github urls "repository": {! "type": "git",! "url": "git://github.com/robertkowalski/fosdem"! }

  27. shorthand style to the rescue! "repository": {! "type": "git",! "url":

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

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

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

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

  32. None
  33. None
  34. better search output trimmed now, use --long for full, long

    output
  35. Why am I telling you this?

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

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

    npm link
  38. Q & A

  39. Thanks! Robert Kowalski rok@kowalski.gd - @robinson_k