SlideShare a Scribd company logo
The Package Manager for Node
Disclaimer

• I'm going to talk about how npm works.
• It works the way I want it to work.
• There are a lot of trade-offs and paths.
• We can be different and still be friends.
wtf is a npm?

• If you're here, you've probably used it
• v1.0 just landed
• curl http://npmjs.org/install.sh | sh
Vision

         To increase speed:

Either push harder, or reduce friction.

      If everyone is doing one,
            do the other.
Vision

• 2009: Lots of folks pushing hard on node.
• Wanted a way to easily install the
  things people were making.
• Starting with a clean slate. Get it right.
  No dependency hell allowed!
Sources of Friction

• Conflicting dependencies
• Inconsistent surfaces
• Excessive metadata
• Publication cabal
Sources of Friction

• Conflicting dependencies
• Inconsistent surfaces
• Excessive metadata
• Publication cabal
Conflicting
        dependencies
• Try to install foo 1.0.0
• foo 1.0.0 → bar >= 1.0.0
• bar 1.2.3 → baz > 2.0.0.
• baz 2.1.2 → foo >2.0.0
• CONFLICT.
Conflicting
dependencies
Sources of Friction

• Conflicting dependencies
• Inconsistent surfaces
• Excessive metadata
• Publication cabal
Inconsistent surfaces
• Before:
 • clone this git repo, then run "make", then
    copy this file into your .node_libraries
    folder, and make sure you name it
    "whatever.js", and that you have some
    version of "blab" already installed there, I
    think the latest version on github works.
Inconsistent surfaces

• After:
 • npm install whatever
 • require("whatever")
Inconsistent surfaces


      THIS IS EASIER.
Sources of Friction

• Conflicting dependencies
• Inconsistent surfaces
• Excessive metadata
• Publication cabal
Excessive metadata

• In npm, it's just a package.json
• Only two required fields:
 • name
 • version
• Lots of optional stuff:
  See `npm help json`
Sources of Friction

• Conflicting dependencies
• Inconsistent surfaces
• Excessive metadata
• Publication cabal
Publication cabal

• aka "permission to publish"
• Sensible in the Debian world
• Not so much in Node
• Anarchic Dictatorship
convention vs
        configuration
• Popular mantra:
  Convention over Configuration
• Convention is like kids:
  It has to grow up at its own speed.
• Having it before you're ready is unwise.
convention vs
configuration
convention vs
        configuration
• Perl: 24 years old
convention vs
        configuration
• Perl: 24 years old
• Python: 20 years old
convention vs
        configuration
• Perl: 24 years old
• Python: 20 years old
• Ruby: 16 years old
convention vs
        configuration
• Perl: 24 years old
• Python: 20 years old
• Ruby: 16 years old
• Node: 2 years old
convention vs
         configuration
• Standing on the shoulders of giants, yes.
• Impressive and important, absolutely.
• Meteorically hacker-news spamming.
• But the community is still finding its voice.
convention vs
         configuration
• Be a pain-killer, not a vitamin, not surgery
• "Here's a package.json file" vs
  "Please structure your program like this."
• Patterns that make sense for Python/Ruby
  don't always make sense for Node.
convention vs
         configuration
• Better model:
  Configuration in search of convention
• Enable as much as possible,
  then bless popular patterns as they arise.
• This is a process. It is organic.
Today...

• almost 1900 projects from
  775 active package authors
• Too many to list in a lunch
  (even if you're Marak)
• ~300 new packages per month
  ~2000 updates per month
Today...


    At the next NodeConf,
I will show you that last slide.
    You will say, "So few?"
Today...


npm is valuable because of
  what you do with it.
how it works
   The $0.50 tour
The Registry

• A Couchapp:
 • http://isaacs.ic.ht/registry
 • https://github.com/isaacs/npmjs.org
• JSON: http://registry.npmjs.org/
• HTML: http://search.npmjs.org/
The Registry

• Tarballs are attachments to package docs
• "npm adduser" to auth
• "npm owner" to manage ownership
• CouchDB rocks for this.
Behind the Firewall
• Several companies running their own
  internal registries.
• "private":true
• "publishConfig" :
      {"registry":"http://internal"}
• Replicate from the public reg (if you want)
anarchic dictatorship

• If you publish it, it's yours.
• Land-grab for names.
• Authors admin their own stuff,
  simple permission scheme
anarchic dictatorship

• Packages get abandoned
• Authors go awol
• Programs can be malicious or misleading
• Having a server admin is important
  <i@izs.me> (don't be creepy)
The cache


• In ~/.npm, registry items are cached.
• ETags FTW!
new in 1.0

• *vastly* simplified folder structure
• Smarter .gitignore/.npmignore handling
  (ie, it works how you think now)
• global vs local installation
new in 1.0

• *vastly* simplified folder structure
• Smarter .gitignore/.npmignore handling
  (ie, it works how you think now)
• global vs local installation
global vs local


• Any command: add `-g` to do it globally.
• Local by default ("always bundle")
global vs local


• Global goes in /usr/local
• Local goes in $PWD/node_modules
global vs local


• Global for putting bin files in the PATH
• Local for require()
global vs local


• Global root is not in node's require path.
• Local root is.
global vs local


 Yes, this is on purpose.
global vs local


       Try it!
    You'll like it!
node_modules

• Packages are installed into node_modules
• Dependencies are nested.
• Cycles handled smartly
Scripts

• Hash of {<event>:<command>}
• npm runs scripts as "nobody" if you're root
• prefoo, foo, postfoo
• The env has all KINDS of data.
Scripts
           (The Important Ones)


• install: When your package is installed.
• start: How to start your server.
• test: Run by the `npm test` command.
• prepublish: Before publishing
Scripts

• Definitely include a "test" script.
• npat! You will super <3 this!
• (Also, tests make you look like a grown up.)
commands


• Files in npm's source as lib/<cmd>.js
• Hang on the npm object at
  npm.commands.<cmd>
commands

• Pretty big CLI app in Node.js
• npm completion
• npm install -h
• abbrev support
install

• If you only know a single npm command,
  this is the one to know.
• With no args:
  Install deps locally, run build scripts
link

• "I want to make changes to node-foo lib,
  and have all my projects always see the
  latest code."
• "I want to make changes to node-foo cli
  app, and always have `foo` run the latest
  code."
link


• See changes without re-installing.
• Read more: `npm help link`
ls
• Displays installed packages
• ls -g -- List global packages
• ls -p -- List in parseable format
• ls -l -- List in "long" format (more data)
• Combine 'em: ls<rimshot>
  still MIT licensed, though
                             -gpl
npm reusable team

• Pieces spun off as standalone projects:
 • nopt - the option parser
 • semver - the version thingie
 • abbrev - like ruby's Abbrev
• More coming soon!
The Future
the part where I make promises
   and get myself into trouble
bindist

• On publish, pre-compile binary addons.
• Required for eventual Windows support
• Experimental, but working surprisingly well.
• (probably hideously broken somehow)
npat

• npm Package Testers
• Inspired by Perl's CPANTs, the best damn
  distributed CI testing system yet devised.
• Ours will be even better, because CPANTs
  wasn't built in a world where CPANTs had
  already been built. :)
npat

• To get on the bandwagon:
  npm set npat true
• installs devDependencies and runs tests
• Fail fast! Fail hard!
  (Then install with --no-npat )
npat

• Results will be uploaded to a database
• "Which platforms should I care about?"
• "Which packages work on my platform?"
• Npat will tell you.
Build Farms

               npat reports +
            binary distributions +
   servers in multiple operating systems =
Ultimate Package Test Integration Mega Engine
Build Farms

               npat reports +
            binary distributions +
   servers in multiple operating systems =
Ultimate Package Test Integration Mega Engine
Build Farms

               npat reports +
            binary distributions +
    vm's in multiple operating systems =
Ultimate Package Test Integration Mega Engine
Build Farms

               npat reports +
            binary distributions +
    vm's in multiple operating systems =
Ultimate Package Test Integration Mega Engine
Build Farms

               npat reports +
            binary distributions +
    vm's in multiple operating systems =
Ultimate Package Test Integration Mega Engine
Build Farms


      UPTIME!




 (It's a working title.)
Build Farms

• Build everything as it's published
• Publish bindists back to the registry
• Run tests and upload results
• Seriously, it's gonna rock
How you can help

• Keep building awesome stuff with Node
• Open-source your reusable libraries
• Publish to the npm registry
• Help out with some of that future stuff
• Provide feedback, find bugs, help n00bs
http://j.mp/nodeconf-npm                  Questions?




                           ...loves you




                                 npm loves you

More Related Content

What's hot (20)

PPTX
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
PPTX
Day 8 - jRuby
Barry Jones
 
PDF
Afrimadoni the power of docker
PHP Indonesia
 
PDF
Why use Go for web development?
Weng Wei
 
PDF
Integrating Node.js with PHP
Lee Boynton
 
PDF
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
PPTX
3 Things Everyone Knows About Node JS That You Don't
F5 Buddy
 
PPTX
Ruby, the language of devops
Rob Kinyon
 
PDF
Node js first look - 2016
Yauheni Nikanovich
 
PPT
Ruby On Rails Presentation
ChanHan Hy
 
PPTX
Create Rest API in Nodejs
Irfan Maulana
 
PDF
Bringing Interactivity to Your Drupal Site with Node.js Integration
Acquia
 
KEY
ClubAJAX Basics - Server Communication
Mike Wilcox
 
PPTX
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Adler Hsieh
 
PPTX
Node.js
RTigger
 
PPTX
Day 9 - PostgreSQL Application Architecture
Barry Jones
 
PPT
Node js
Chirag Parmar
 
PDF
Getting Started With WP REST API
Kishor Kumar
 
PPTX
Future-proof Development for Classic SharePoint
Bob German
 
PDF
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
PHP Indonesia - Nodejs Web Development
Irfan Maulana
 
Day 8 - jRuby
Barry Jones
 
Afrimadoni the power of docker
PHP Indonesia
 
Why use Go for web development?
Weng Wei
 
Integrating Node.js with PHP
Lee Boynton
 
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
3 Things Everyone Knows About Node JS That You Don't
F5 Buddy
 
Ruby, the language of devops
Rob Kinyon
 
Node js first look - 2016
Yauheni Nikanovich
 
Ruby On Rails Presentation
ChanHan Hy
 
Create Rest API in Nodejs
Irfan Maulana
 
Bringing Interactivity to Your Drupal Site with Node.js Integration
Acquia
 
ClubAJAX Basics - Server Communication
Mike Wilcox
 
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Adler Hsieh
 
Node.js
RTigger
 
Day 9 - PostgreSQL Application Architecture
Barry Jones
 
Node js
Chirag Parmar
 
Getting Started With WP REST API
Kishor Kumar
 
Future-proof Development for Classic SharePoint
Bob German
 
Developing realtime apps with Drupal and NodeJS
drupalcampest
 

Viewers also liked (9)

PDF
npm: Modularizing your JavaScript development
Ruy Adorno
 
PDF
Использовании TypeScript для Node.js
FullStackJS
 
PDF
Npm: beyond 'npm i'
Pieter Herroelen
 
PDF
Npm scripts
정윤 김
 
PDF
How to Write Node.js Module
Fred Chien
 
PDF
Introduction to NPM and building CLI Tools with Node.js
Suroor Wijdan
 
PDF
Harnessing the power of YARN with Apache Twill
Terence Yim
 
PDF
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Ryan Weaver
 
npm: Modularizing your JavaScript development
Ruy Adorno
 
Использовании TypeScript для Node.js
FullStackJS
 
Npm: beyond 'npm i'
Pieter Herroelen
 
Npm scripts
정윤 김
 
How to Write Node.js Module
Fred Chien
 
Introduction to NPM and building CLI Tools with Node.js
Suroor Wijdan
 
Harnessing the power of YARN with Apache Twill
Terence Yim
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Ryan Weaver
 
Ad

Similar to Nodeconf npm 2011 (20)

PPTX
Building Open-Source React Components
Zack Argyle
 
PPTX
Building Open-source React Components
Zack Argyle
 
PDF
perlbrew yapcasia 2010
Kang-min Liu
 
PDF
Ninja, Choose Your Weapon!
Anton Weiss
 
PDF
CentOS at Facebook
Phil Dibowitz
 
PDF
Perl Dist::Surveyor 2011
Tim Bunce
 
PDF
Packaging is the Worst Way to Distribute Software, Except for Everything Else
mckern
 
PPTX
ASP.NET 5 auf Raspberry PI & docker
Jürgen Gutsch
 
KEY
Migrating big data
lauraxthomson
 
PDF
21st Century CPAN Testing: CPANci
Mike Friedman
 
KEY
Dcjq node.js presentation
async_io
 
ODP
Deploying your SaaS stack OnPrem
Kris Buytaert
 
PDF
Python+gradle
Stephen Holsapple
 
KEY
Real time system_performance_mon
Tomas Doran
 
PDF
Package Management and Chef - ChefConf 2015
Chef
 
PDF
Chef Conf 2015: Package Management & Chef
ice799
 
PDF
CNPM: Private NPM for Company / 企業級私有NPM
Feng Yuan
 
PDF
Packaging perl (LPW2010)
p3castro
 
PDF
Midwest php 2013 deploying php on paas- why & how
dotCloud
 
PDF
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Building Open-Source React Components
Zack Argyle
 
Building Open-source React Components
Zack Argyle
 
perlbrew yapcasia 2010
Kang-min Liu
 
Ninja, Choose Your Weapon!
Anton Weiss
 
CentOS at Facebook
Phil Dibowitz
 
Perl Dist::Surveyor 2011
Tim Bunce
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
mckern
 
ASP.NET 5 auf Raspberry PI & docker
Jürgen Gutsch
 
Migrating big data
lauraxthomson
 
21st Century CPAN Testing: CPANci
Mike Friedman
 
Dcjq node.js presentation
async_io
 
Deploying your SaaS stack OnPrem
Kris Buytaert
 
Python+gradle
Stephen Holsapple
 
Real time system_performance_mon
Tomas Doran
 
Package Management and Chef - ChefConf 2015
Chef
 
Chef Conf 2015: Package Management & Chef
ice799
 
CNPM: Private NPM for Company / 企業級私有NPM
Feng Yuan
 
Packaging perl (LPW2010)
p3castro
 
Midwest php 2013 deploying php on paas- why & how
dotCloud
 
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Ad

Recently uploaded (20)

PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 

Nodeconf npm 2011

  • 2. Disclaimer • I'm going to talk about how npm works. • It works the way I want it to work. • There are a lot of trade-offs and paths. • We can be different and still be friends.
  • 3. wtf is a npm? • If you're here, you've probably used it • v1.0 just landed • curl http://npmjs.org/install.sh | sh
  • 4. Vision To increase speed: Either push harder, or reduce friction. If everyone is doing one, do the other.
  • 5. Vision • 2009: Lots of folks pushing hard on node. • Wanted a way to easily install the things people were making. • Starting with a clean slate. Get it right. No dependency hell allowed!
  • 6. Sources of Friction • Conflicting dependencies • Inconsistent surfaces • Excessive metadata • Publication cabal
  • 7. Sources of Friction • Conflicting dependencies • Inconsistent surfaces • Excessive metadata • Publication cabal
  • 8. Conflicting dependencies • Try to install foo 1.0.0 • foo 1.0.0 → bar >= 1.0.0 • bar 1.2.3 → baz > 2.0.0. • baz 2.1.2 → foo >2.0.0 • CONFLICT.
  • 10. Sources of Friction • Conflicting dependencies • Inconsistent surfaces • Excessive metadata • Publication cabal
  • 11. Inconsistent surfaces • Before: • clone this git repo, then run "make", then copy this file into your .node_libraries folder, and make sure you name it "whatever.js", and that you have some version of "blab" already installed there, I think the latest version on github works.
  • 12. Inconsistent surfaces • After: • npm install whatever • require("whatever")
  • 13. Inconsistent surfaces THIS IS EASIER.
  • 14. Sources of Friction • Conflicting dependencies • Inconsistent surfaces • Excessive metadata • Publication cabal
  • 15. Excessive metadata • In npm, it's just a package.json • Only two required fields: • name • version • Lots of optional stuff: See `npm help json`
  • 16. Sources of Friction • Conflicting dependencies • Inconsistent surfaces • Excessive metadata • Publication cabal
  • 17. Publication cabal • aka "permission to publish" • Sensible in the Debian world • Not so much in Node • Anarchic Dictatorship
  • 18. convention vs configuration • Popular mantra: Convention over Configuration • Convention is like kids: It has to grow up at its own speed. • Having it before you're ready is unwise.
  • 20. convention vs configuration • Perl: 24 years old
  • 21. convention vs configuration • Perl: 24 years old • Python: 20 years old
  • 22. convention vs configuration • Perl: 24 years old • Python: 20 years old • Ruby: 16 years old
  • 23. convention vs configuration • Perl: 24 years old • Python: 20 years old • Ruby: 16 years old • Node: 2 years old
  • 24. convention vs configuration • Standing on the shoulders of giants, yes. • Impressive and important, absolutely. • Meteorically hacker-news spamming. • But the community is still finding its voice.
  • 25. convention vs configuration • Be a pain-killer, not a vitamin, not surgery • "Here's a package.json file" vs "Please structure your program like this." • Patterns that make sense for Python/Ruby don't always make sense for Node.
  • 26. convention vs configuration • Better model: Configuration in search of convention • Enable as much as possible, then bless popular patterns as they arise. • This is a process. It is organic.
  • 27. Today... • almost 1900 projects from 775 active package authors • Too many to list in a lunch (even if you're Marak) • ~300 new packages per month ~2000 updates per month
  • 28. Today... At the next NodeConf, I will show you that last slide. You will say, "So few?"
  • 29. Today... npm is valuable because of what you do with it.
  • 30. how it works The $0.50 tour
  • 31. The Registry • A Couchapp: • http://isaacs.ic.ht/registry • https://github.com/isaacs/npmjs.org • JSON: http://registry.npmjs.org/ • HTML: http://search.npmjs.org/
  • 32. The Registry • Tarballs are attachments to package docs • "npm adduser" to auth • "npm owner" to manage ownership • CouchDB rocks for this.
  • 33. Behind the Firewall • Several companies running their own internal registries. • "private":true • "publishConfig" : {"registry":"http://internal"} • Replicate from the public reg (if you want)
  • 34. anarchic dictatorship • If you publish it, it's yours. • Land-grab for names. • Authors admin their own stuff, simple permission scheme
  • 35. anarchic dictatorship • Packages get abandoned • Authors go awol • Programs can be malicious or misleading • Having a server admin is important <[email protected]> (don't be creepy)
  • 36. The cache • In ~/.npm, registry items are cached. • ETags FTW!
  • 37. new in 1.0 • *vastly* simplified folder structure • Smarter .gitignore/.npmignore handling (ie, it works how you think now) • global vs local installation
  • 38. new in 1.0 • *vastly* simplified folder structure • Smarter .gitignore/.npmignore handling (ie, it works how you think now) • global vs local installation
  • 39. global vs local • Any command: add `-g` to do it globally. • Local by default ("always bundle")
  • 40. global vs local • Global goes in /usr/local • Local goes in $PWD/node_modules
  • 41. global vs local • Global for putting bin files in the PATH • Local for require()
  • 42. global vs local • Global root is not in node's require path. • Local root is.
  • 43. global vs local Yes, this is on purpose.
  • 44. global vs local Try it! You'll like it!
  • 45. node_modules • Packages are installed into node_modules • Dependencies are nested. • Cycles handled smartly
  • 46. Scripts • Hash of {<event>:<command>} • npm runs scripts as "nobody" if you're root • prefoo, foo, postfoo • The env has all KINDS of data.
  • 47. Scripts (The Important Ones) • install: When your package is installed. • start: How to start your server. • test: Run by the `npm test` command. • prepublish: Before publishing
  • 48. Scripts • Definitely include a "test" script. • npat! You will super <3 this! • (Also, tests make you look like a grown up.)
  • 49. commands • Files in npm's source as lib/<cmd>.js • Hang on the npm object at npm.commands.<cmd>
  • 50. commands • Pretty big CLI app in Node.js • npm completion • npm install -h • abbrev support
  • 51. install • If you only know a single npm command, this is the one to know. • With no args: Install deps locally, run build scripts
  • 52. link • "I want to make changes to node-foo lib, and have all my projects always see the latest code." • "I want to make changes to node-foo cli app, and always have `foo` run the latest code."
  • 53. link • See changes without re-installing. • Read more: `npm help link`
  • 54. ls • Displays installed packages • ls -g -- List global packages • ls -p -- List in parseable format • ls -l -- List in "long" format (more data) • Combine 'em: ls<rimshot> still MIT licensed, though -gpl
  • 55. npm reusable team • Pieces spun off as standalone projects: • nopt - the option parser • semver - the version thingie • abbrev - like ruby's Abbrev • More coming soon!
  • 56. The Future the part where I make promises and get myself into trouble
  • 57. bindist • On publish, pre-compile binary addons. • Required for eventual Windows support • Experimental, but working surprisingly well. • (probably hideously broken somehow)
  • 58. npat • npm Package Testers • Inspired by Perl's CPANTs, the best damn distributed CI testing system yet devised. • Ours will be even better, because CPANTs wasn't built in a world where CPANTs had already been built. :)
  • 59. npat • To get on the bandwagon: npm set npat true • installs devDependencies and runs tests • Fail fast! Fail hard! (Then install with --no-npat )
  • 60. npat • Results will be uploaded to a database • "Which platforms should I care about?" • "Which packages work on my platform?" • Npat will tell you.
  • 61. Build Farms npat reports + binary distributions + servers in multiple operating systems = Ultimate Package Test Integration Mega Engine
  • 62. Build Farms npat reports + binary distributions + servers in multiple operating systems = Ultimate Package Test Integration Mega Engine
  • 63. Build Farms npat reports + binary distributions + vm's in multiple operating systems = Ultimate Package Test Integration Mega Engine
  • 64. Build Farms npat reports + binary distributions + vm's in multiple operating systems = Ultimate Package Test Integration Mega Engine
  • 65. Build Farms npat reports + binary distributions + vm's in multiple operating systems = Ultimate Package Test Integration Mega Engine
  • 66. Build Farms UPTIME! (It's a working title.)
  • 67. Build Farms • Build everything as it's published • Publish bindists back to the registry • Run tests and upload results • Seriously, it's gonna rock
  • 68. How you can help • Keep building awesome stuff with Node • Open-source your reusable libraries • Publish to the npm registry • Help out with some of that future stuff • Provide feedback, find bugs, help n00bs
  • 69. http://j.mp/nodeconf-npm Questions? ...loves you npm loves you

Editor's Notes