npm: new and undocumented features

npm: new and undocumented features

Node has one of the best package managers around: npm. With over 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 of npm to make you a more productive npm user.

765845d4b1c07dd284eae0866d1d7939?s=128

Robert Kowalski

December 16, 2013
Tweet

Transcript

  1. npm: new and undocumented features Robert Kowalski @robinson_k ! !

    HH.js - December 2013
  2. marc falardeau - http://www.flickr.com/photos/49889874@N05/4772680734/

  3. npm grows ! ! ! ! 0 15000 30000 45000

    60000 2011 2012 2013 Package count Sources: Isaac Schlueter: „How npm Works“, nodeconf 2011 and 
 http://www.modulecounts.com/
  4. Juriën Minke - http://www.flickr.com/photos/jeminke/7009161635/ fast development

  5. Community news

  6. European npm mirror Latency :-(

  7. European npm mirror $ npm install express npmjs.org: 25.677s npmjs.eu:

    5.719s
  8. European npm mirror npmjs.eu visit http://npmjs.eu/ for docs how to

    use it
  9. New or undocumented features

  10. npm init Demo!

  11. hidden gem: undocumented feature $ npm config set init-module $YOUR_PATH_TO_THE_TEMPLATE!

    Example template: 
 https://github.com/isaacs/promzard/blob/master/example/substack-input.js
  12. {! "name": "hamburg-js",! "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/hamburg-js"! }! }!
  13. Boring github urls "repository": {! "type": "git",! "url": "git://github.com/robertkowalski/hamburg-js"! }

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

    "robertkowalski/hamburg-js"! }
  15. Your homepage is the github page? {! "homepage": "http://github.com/robertkowalski/hamburg-js",! "repository":

    {! "type": "git",! "url": "git://github.com/robertkowalski/hamburg-js"! }! }!
  16. just keep it off "repository": {! "type": "git",! "url": "robertkowalski/hamburg-js"!

    }
  17. outdated update "dependencies": {! "express": "~3.3.1"! }

  18. outdated update "dependencies": {! "express": "~3.3.1"! }

  19. None
  20. None
  21. npm outdated --json

  22. npm ls --json Demo!

  23. Why I am telling you this?

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

  25. Thanks Robert Kowalski ! @robinson_k

  26. Bonus slide JS Unconf is a thing Geomatikum Hamburg -

    26./27. April 2014 Tickets: http://jsunconf.eu