JSPM

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

Require with Namespace

Package Exports

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

Readme

ns-require

Codecov downloads npm GitHub

Require with Namespace.

Basic Usage

import ns from 'ns-require'

const scope = ns({
  namespace: 'awesome',
  prefix: 'plugin',
})

scope.require('foo')        // will resolve to `awesome-plugin-foo`
scope.require('@foo/bar')   // will resolve to `@foo/awesome-plugin-bar`

With Official Scope

import ns from 'ns-require'

const scope = ns({
  namespace: 'awesome',
  prefix: 'plugin',
  official: 'scope',
})

scope.require('foo')        // will resolve to `@scope/plugin-foo`
                            // and then `awesome-plugin-foo`
scope.require('@foo/bar')   // will resolve to `@foo/awesome-plugin-bar`