imex

0.0.6 • Public • Published

ImEx.js

JavaScript 'import/export' compiler.####

Compiler allows you to use import/export directives and then compile the code to native JavaScript. It is very lightweight with low complexity.

Usage####

If you have objects World.animals, World.Animal
And want to create new object like World.animals.Dog you write

namespace World.animals;
 
import World.Animal;
 
export Dog = function () {};
Dog.prototype = Object.create( Animal.prototype );

instead of crappy long code like

World.animals.Dog = function () {};
World.animals.Dog.prototype = Object.create( World.animals.Animal );

If you want to create global variable like World (window.World) you create like

namespace Global;
 
export World = {};

Compiling####

Execute in your cmd [in the folder of compiler util]
node build.js --include ../example/in/include.json --out ../example/out/build.js

Or use compiler.cmd as in the example.

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i imex

    Weekly Downloads

    5

    Version

    0.0.6

    License

    https://raw.github.com/ohmed/ImEx.js/master/LICENSE

    Last publish

    Collaborators

    • ohmed