# mami

> This is the one who cares about your dependencies.

Latest version **1.0.0** (published 2017-11-19) · ISC license · 0 weekly downloads

## Install

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

## 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.0.0 |
| Published | 2017-11-19 |
| First published | 2017-11-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Maslakov |
| Maintainers | jmas |
| Keywords | javascript, js, di, dependencies, manager |

## Links

- npm: https://www.npmjs.com/package/mami
- Repository: https://github.com/jmas/mami
- Homepage: https://github.com/jmas/mami#readme
- Issues: https://github.com/jmas/mami/issues
- npm.io page: https://npm.io/package/mami

## Dependencies (1)

- [rollup](https://npm.io/package/rollup.md) ^0.51.7

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-11-19

## README

# Mami

This is the one who cares about your dependencies.

## Example

```js
import mami from 'mami';

const get = mami({
    loadModule: moduleName => import(`./modules/${moduleName}`).then(exports => exports['default']),
    modules: {
        dispatcher: load => load('dispatcher'),
        views: load => load('views'),
        router: load => load('router'),
        app: {
            dispatcher: get => get('dispatcher'),
            views: get => get('views').then(views => views({
                globals: {
                    appName: 'Welcome'
                }
            })),
            router: get => get('router'),
        }
    }
});

get('app').then(app => app.render(document.body));
```

## API

### `mami(options: Object): Function`

| Option name | Description |
| --- | --- |
| `loadModule: Function` | Function that load modules. It should return `Promise` that should return loaded module content. |
| `modules: Object` | Keys of that object is a module name (any word). Values is a object or function that tell mami what dependencies is required. |

Returns function that give you ability to get any described module.

```js
const get = mami({
    loadModule,
    modules: {
        a: load => load('my_a')
    }
});
get('a') // returns Promise
    .then(aModuleContent => {
        console.log(aModuleContent);
    })
    .catch(error => console.log(error));
```

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