require-statements
v1.1.2
Published
Generators require statements from `package.json`.
Downloads
6
Maintainers
Readme
require-statements
Generators require statements from
package.json
.
Install
$ npm install --save require-statements
Usage
var requireStatements = require('require-statements');
requireStatements();
// ^ Would read `./package.json` and return require statements for dependencies.
console.log(requireStatements('./package.json'));
/*
var camelcase = require('camelcase');
var meow = require('meow');
*/
console.log(requireStatements('./package.json',{import: true}));
/*
import camelcase from 'camelcase';
import meow from 'meow';
*/
API
requireStatements([flag][path])
path
Type: string
Path to the package.json
defaults to ./package.json
flag
Type: string
--import
for import statements instead.
License
MIT © Hemanth.HM