JSPM

deep-resolve-from

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

Resolve the path of a module through a sequence of packages

Package Exports

  • deep-resolve-from

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 (deep-resolve-from) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

deep-resolve-from

Resolve the path of a module through a sequence of packages

npm version Build Status

Installation

npm i -S deep-resolve-from

Usage

'use strict'
const deepResolveFrom = require('deep-resolve-from')

console.log(deepResolveFrom(process.cwd(), ['mos', 'chalk', './package.json']))
//> /home/zkochan/src/deep-resolve-from/node_modules/.registry.npmjs.org/chalk/1.1.3/node_modules/chalk/package.json

API

deepResolveFrom(fromDir, moduleIds)

Like require(), throws when the module can't be found.

deepResolveFrom.silent(fromDir, moduleIds)

Returns null instead of throwing when the module can't be found.

fromDir

Type: string

Directory to resolve from.

moduleIds

Type: string[]

An array of module IDs, a module ID is something that you pass to require().

  • resolve-from - Resolve the path of a module like require.resolve() but from a given path

License

MIT © Zoltan Kochan