Skip to content

iolo/node-packagestyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

packagestyle

packagestyle is java package style module loader.

how to install

npm install -g packagestyle

or

npm install -g packagestyle

or

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

how to use by example

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...

About

java package style module loader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published