Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Robert Kowalski

February 02, 2014
Tweet

More Decks by Robert Kowalski

Other Decks in Technology

Transcript

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

    Source: http://blog.nodejs.org/2014/01/15/the-next-phase-of-node-js/
  3. CDN Support +-------+ | | |CouchDB| | | +--+----+ |

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

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

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





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

    CDN: 4.428s 5.7x EU-Mirror: 2.652s 9.6x
  7. Examples for Computing Find out which of your module APIs

    are deprecated Security Audits on the whole registry (https://nodesecurity.io/)
  8. 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
  9. npm init module.exports = {! "name" : basename,! "version" :

    "0.0.0",! "description" : prompt("description", "fosdem"),! "license" : "MIT"! }
  10. {! "name": "fosdem",! "license": "BSD",! "version": "1.0.0",! "author": "Robert Kowalski

    <[email protected]>",! "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"! }! }!
  11. Your homepage is the github page? {! "homepage": "http://github.com/robertkowalski/fosdem",! "repository":

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