magic-import

1.0.3 • Public • Published

magic-import

Importing files in node.js sucks, because you have to edit every single require() call whenever you restructure your subdirectories.

The following code is boring and lame:

const importantModule = require("../importantModule");
const moduleInDir = require("./path/to/dir/ModuleInDir");

What if you could do something exciting and cool like:

const {
	importantModule, 
	moduleInDir
} = require("magic-import");

Well, now you can!

Installation

npm install magic-import

Notes

NOTE: Due to the fact subdirectories are ignored when specifying modules, every module in your project MUST be named differently.

Package Sidebar

Install

npm i magic-import

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

3.43 kB

Total Files

3

Last publish

Collaborators

  • chrisdrifter_