# appbox

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

Latest version **0.0.2** (published 2014-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install appbox
pnpm add appbox
yarn add appbox
bun add appbox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-10-07 |
| First published | 2014-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cédric Ronvel |
| Maintainers | cronvel |
| Keywords | appbox, box, module, lazy, loading |

## Links

- npm: https://www.npmjs.com/package/appbox
- Repository: https://github.com/cronvel/appbox
- Issues: https://github.com/cronvel/appbox/issues
- npm.io page: https://npm.io/package/appbox

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads
- [react-native-modal-translucent-axton](https://npm.io/package/react-native-modal-translucent-axton.md) — 4 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-10-07

## README

# 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)
<a name=""></a>
 
<a name="loading-all-module-from-the-map-file"></a>
# Loading all module from the map file
with full-loading.

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

```js
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 ) ;
```

---
_Source: https://npm.io/package/appbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
