@kingjs/create-depjs

1.0.0 • Public • Published

@kingjs/create-depjs

Generates dependencies.js which exports the dependencies in package.json.

Usage

Given a package.json like this:

{
  "name": "@kingjs/tools.create-dependencies-js",
  "version": "1.0.0",
  "dependencies": {
    "@kingjs/camel-case.join": "^1.0.0",
    "@kingjs/package-name.parse": "^1.0.1"
  }
}

Running this:

$ cdj 

Produces a dependencies.js like this:

exports['@kingjs'] = {
  camelCase: {
    join: require('@kingjs/camel-case.join'),
  },
  packageName: {
    parse: require('@kingjs/package-name.parse'),
  },
}

Which can then be used in like this:

var assert = require('assert');

var { 
  ['@kingjs']: {
    packageName: { parse },
    camelCase: { join }
  }
} = require('./dependencies');

assert(parse);
assert(join);

Remarks

Using dependencies.js ensures that production code requires only packages listed in as dependencies in package.json.

Install

With npm installed, run

$ npm install -g @kingjs/create-depjs

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @kingjs/create-depjs

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.34 kB

Total Files

6

Last publish

Collaborators

  • kingces95