Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.27 KB

File metadata and controls

47 lines (34 loc) · 1.27 KB

NPM

NPM is a CLI, a Registry, a Community and a Company.

exports.setup = function() {};
exports.enable = function() {};
exports.ready = true;

// Can't later do exports again!
module.exports = {
  setup: function() {},
  ready: true
};

// To save guard yourself from exporting again
exports = module.exports = {
};

npm@3

Q: How would it handle if 2+ dependencies require different versions of the same dependency?

A: In that case, each dependency with a conflicting version on the same dependency would get its own, nested copy of that conflicting dependency. That's why we describe the install tree as maximally flat - it will still allow nesting in the case of conflict.

CLI

▶ npm config ls -l
▶ npm info nodemon
▶ npm list --depth=0
▶ npm list -g --depth=0
▶ npm view eslint dependencies

▶ npm init
▶ npm init auto // detect your code
▶ ~/.npm-init.js

▶ npm install --save --save-bundle