Narrating Prophetic Monks
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

can-namespace

1.0.0 • Public • Published

can-namespace

Namespace where can-* packages are registered

Usage

can-namespace exports an object that can be used to ensure only one version of a module is loaded in an app.

For example, if you have a module can-unicorn that you want to make sure is only loaded a single time, you can use can-namespace:

var namespace = require('can-namespace');
 
var unicorn = {
    // ...
};
 
if (namespace.unicorn) {
    throw new Error("You can't have two versions of can-unicorn, check your dependencies");
} else {
    module.exports = namespace.unicorn = unicorn;
}

Any module requiring can-namespace will receive the same module because only one version of can-namespace will ever be published.

install

npm i can-namespace

Downloadsweekly downloads

2,046

version

1.0.0

license

none

homepage

canjs.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability