ns-require
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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`

/ns-require/

    Package Sidebar

    Install

    npm i ns-require

    Weekly Downloads

    1,382

    Version

    1.1.4

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • shigma