packagestyle

0.0.2 • Public • Published

packagestyle

packagestyle is java package style module loader.

installation

npm install -g packagestyle

or

npm install -g packagestyle

or

git clone git@github.com:iolo/node-packagestyle.git

usage

directory structure

/your_project_dir
  /bin
    /main.js /* this is main module */
  /lib
    /hello
      /world.js
      /foo
        /bar.js

bin/main.js

// NOTE: GLOBAL to declare global variable
require('packagestyle').imports('../lib/hello', GLOBAL);
hello.world.greet('iolo');

lib/hello/world.js

// NOTE: no require!!!
var puts = hello.foo.bar.puts;
exports.greet = function(name) {
  puts('hello,' + name);
};

lib/hello/foo/bar.js

exports.puts = function(msg) {
  console.log(msg);
};

may the source be with you...

Readme

Keywords

none

Package Sidebar

Install

npm i packagestyle

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • iolo