The Plugin extends:
IncludeJS
with a custom loader for theNode.js
versionatma-io
with a custom middlewareatma-server
andAtma Toolkit
with aHTTPHandler
to serve compiled sources (with sourceMap support)
Load scripts from a directory as a package, assume this structure and the loading process:
lib
+-- Foo
| |-- foo.js
|
|-- A.js
|-- B.js
// load all files
include
.js('./lib/.package::Lib')
// similar to the glob version: `./lib/**.js.package`
.done(function(resp){
resp.Lib.A //> Exports Object from `lib/A.js' file
resp.Lib.B //> Exports Object from `lib/B.js' file
resp.Lib.Foo.foo //> Exports Object from `lib/Foo/foo.js' file
});
// load only root files
include
.js('./lib/*.js.package')
.done(function(resp){
resp.Lib.A //> Exports Object from `lib/A.js' file
resp.Lib.B //> Exports Object from `lib/B.js' file
})
npm install atma -g
atma plugin install atma-loader-package
- That's all
@see Tests
The MIT License