JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1459
  • Score
    100M100P100Q105270F
  • License MIT

Locate modules using the Node resolution algorithm, for using third party modules in node_modules

Package Exports

  • node-resolve
  • node-resolve/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-resolve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-resolve

NPM version Downloads Build Status Dependency status Dev Dependency status Coverage Status

Locate modules using the Node resolution algorithm, for using third party modules in node_modules.

v1.3.x breaking change, you have to pass a 'cwd' to resolve, '.' is default.

var nodeResolve = require('node-resolve');

nodeResolve.resolve('src/index.js', './foo/foo', '.');// src/foo/foo.js
nodeResolve.resolve('src/index.js', 'babel-core', '.');// node_modules/babel-core/index.js

undefined is returned if not found, and null is returned if it's a builtin module(fs,path...).

node-resolve supports browser spec.

nodeResolve.resolve('src/index.js', 'inherits', '.', true)// inherits_browser.js
nodeResolve.resolve('src/index.js', 'fs', '.', true)// undefiend