New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

appbox

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appbox

It lets you store all your modules into one global. It supports lazy-loading or full-loading.

0.0.2
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

appBox

It lets you store all your modules into one global. It supports lazy-loading or full-loading.

  • License: MIT
  • Current status: alpha / unstable
  • Platform: Node.js only

Full BDD spec generated by Mocha:

[appBox] Loading module: /home/cedric/inside/github/appbox/test/core/hello.js [appBox] Loading module: /home/cedric/inside/github/appbox/test/core/bonjour.js [appBox] Loading module: /home/cedric/inside/github/appbox/test/circular/one.js [appBox] Loading module: /home/cedric/inside/github/appbox/test/circular/two.js [appBox] Lazy-loading module: /home/cedric/inside/github/appbox/test/core/hello.js [appBox] Lazy-loading module: /home/cedric/inside/github/appbox/test/core/bonjour.js [appBox] Lazy-loading module: /home/cedric/inside/github/appbox/test/circular/one.js [appBox] Lazy-loading module: /home/cedric/inside/github/appbox/test/circular/two.js

TOC

  • Loading all module from the map file

Loading all module from the map file

with full-loading.

delete global.APP ;
appBox.loadMap( 'APP' , './map1.json' , { verbose: true , lazy: false } ) ;

// Ensure the module is already loaded
var descriptor = Object.getOwnPropertyDescriptor( APP.core , 'hello' ) ;
expect( descriptor.value ).to.be.an( Object ) ;
expect( descriptor.get ).to.be( undefined ) ;

expect( APP.core.hello.hello() ).to.be( 'Hello!' ) ;
expect( APP.core.hello.world() ).to.be( 'World!' ) ;
expect( APP.core.hello.helloWorld() ).to.be( 'Hello world!' ) ;
expect( APP.core.bonjour() ).to.be( 'Bonjour !' ) ;
expect( APP.circular.one() ).to.be( 'onetwo' ) ;

with lazy-loading.

delete global.APP ;
appBox.loadMap( 'APP' , './map1.json' , { verbose: true , lazy: true } ) ;

// Ensure the module is *NOT* loaded
var descriptor = Object.getOwnPropertyDescriptor( APP.core , 'hello' ) ;
expect( descriptor.value ).to.be( undefined ) ;
expect( descriptor.get ).to.be.an( Function ) ;

expect( APP.core.hello.hello() ).to.be( 'Hello!' ) ;
expect( APP.core.hello.world() ).to.be( 'World!' ) ;
expect( APP.core.hello.helloWorld() ).to.be( 'Hello world!' ) ;
expect( APP.core.bonjour() ).to.be( 'Bonjour !' ) ;
expect( APP.core.bonjour() ).to.be( 'Bonjour !' ) ;
expect( APP.circular.one() ).to.be( 'onetwo' ) ;
expect( APP.circular.one() ).to.be( 'onetwo' ) ;
expect( APP.circular.two() ).to.be( 'twoone' ) ;

// Ensure the module is now loaded
descriptor = Object.getOwnPropertyDescriptor( APP.core , 'hello' ) ;
expect( descriptor.value ).to.be.an( Object ) ;
expect( descriptor.get ).to.be( undefined ) ;

Keywords

appbox

FAQs

Package last updated on 07 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts