JSPM

deep-require-cwd

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

Require a module like `require()` but via a sequence of nested packages from the current working directory

Package Exports

  • deep-require-cwd

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

Readme

deep-require-cwd

Require a module like `require()` but via a sequence of nested packages from the current working directory

npm version Build Status

Installation

npm i -S deep-require-cwd

Usage

'use strict'
const deepRequireCwd = require('deep-require-cwd')

const pkg = deepRequireCwd(['mos', 'chalk', './package.json'])

console.log(pkg.name)
//> chalk

API

deepRequireCwd(moduleIds)

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

deepRequireCwd.silent(moduleIds)

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

moduleIds

Type: string[]

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

  • deep-require-from - Require a module like require() but via a sequence of nested packages
  • deep-resolve-from - Resolve the path of a module through a sequence of packages
  • deep-resolve-cwd - Resolve the path of a module through a sequence of packages from the current working directory
  • req-cwd - Require a module like require() but from the current working directory

License

MIT © Zoltan Kochan