Skip to content

'Directory-Package' loader for `IncludeJS`, `atma-io`, `atma-server`

Notifications You must be signed in to change notification settings

tenbits/atma-loader-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Package Loader (Atma Plugin)

Build Status

The Plugin extends:

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
    })
How to use
Embed into the Project
  • npm install atma -g
  • atma plugin install atma-loader-package
  • That's all
Quick Try

@see Tests


The MIT License

About

'Directory-Package' loader for `IncludeJS`, `atma-io`, `atma-server`

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published