# node-mr

> Node-mr is a help package to ensure that all modules are loaded before a certain function can be executed.

Latest version **1.1.4** (published 2017-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-mr
pnpm add node-mr
yarn add node-mr
bun add node-mr
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2017-02-05 |
| First published | 2017-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Baetz Daniel |
| Maintainers | saika01 |

## Links

- npm: https://www.npmjs.com/package/node-mr
- Repository: https://github.com/baetz-daniel/node-mr
- Homepage: https://github.com/baetz-daniel/node-mr#readme
- Issues: https://github.com/baetz-daniel/node-mr/issues
- npm.io page: https://npm.io/package/node-mr

## Recent versions

- 1.1.4 (latest) — 2017-02-05
- 1.1.3 — 2017-02-05
- 1.1.2 — 2017-02-05
- 1.1.1 — 2017-02-05

## README

## Information

Node-mr is a help package to ensure that all modules are loaded before a certain function can be executed.

## Example

-index.js

```javascript
const mr = require('node-mr');
const instance = mr.get('instance');
instance.listen(['moduleA','moduleB'], function (modules) {
	//do sth. with moduleA and moduleB if they exists
	modules.moduleA.test();
	modules.moduleB.test();
	
});
```
-moduleA.js

```javascript
const mr = require('node-mr');
const instance = mr.get('instance');

instance.add('moduleA', {
	test: function() {
		console.log('moduleA: test called');
	}
});
```

-moduleB.js

```javascript
const mr = require('node-mr');
const instance = mr.get('instance');

instance.add('moduleB', {
	test: function() {
		console.log('moduleB: test called');
	}
});
```

## Installing

```shell
npm install node-mr
```

## Usage

```javascript
const mr = require('node-mr');
const instance = mr.get([instanceName]);	//returns an existing instance or create a new one
* instanceName - `{string}` - the instance name.<br/>

instance.listen([requiredModules], [callback]);
* requiredModules - `{array}` - the required module names.<br/>
* callback - `{function}` - the callback called if all required modules exists.<br/>

instance.add([modulesName], [exports]);
* modulesName - `{string}` - add a module to the list.<br/>
* exports - `{object}` - module exports.<br/>

```
## Changelog

## License

Copyright (c) 2016-2017 Daniel B�tz <baetz.daniel@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
documentation files (the "Software"), to deal in the Software without restriction, 
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or 
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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