Need private packages and team management tools?Check out npm Teams »

import-generator

0.1.1 • Public • Published

import-generator npm npm

Module schema conversion to import statements

npm install import-generator

Usage

var generator = require('import-generator');
 
// input
var importSchema = {
  "name": "@ali/ice",
  "default": "ICE",
  "members": [{
    "name": "Accordion",
    "alias": "Accordion"
  }, {
    "name": "Button",
    "alias": "Btn"
  }, {
    "name": "Form",
    "alias": "Form"
  }]
}
 
generator(importSchema)
 
// output:
import ICE, { Accordion, Button as Btn, Form } from "@ali/ice";

Related

  • detective-module npm Get the dependencies specifier of an ES6 module

Install

npm i import-generator

DownloadsWeekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • avatar