# gumup

> Simple dynamic JS modules

Latest version **0.2.1** (published 2014-08-01) · MIT license · 0 weekly downloads

## Install

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

## 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.2.1 |
| Published | 2014-08-01 |
| First published | 2014-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Amsemy |
| Maintainers | amsemy |
| Keywords | dependency, gumup, module, resolve, unit |

## Links

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

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2014-08-01
- 0.2.1-rc.2 — 2014-08-01
- 0.2.1-rc.1 — 2014-05-15
- 0.2.0 — 2014-05-07

## README

# Gumup

Gumup is simple JavaScript library that lets to control the order of modules initialization.

## Basic usage

Include Gumup in your page. The library unconditionally occupies a `gumup` global.
```html
<script src="gumup.js"></script>
```
Declare your moudles using `gumup.unit`. Unit implementation function will called in context of created unit instance.
```javascript
gumup.unit('common.foo', function() {
    this.myFunc = function() {};
});
```
If you need a custom object, it can be returned from the implementation function. It can be an object, function or primitive.
```javascript
gumup.unit('utils.bar', function() {
    return "my unit";
});
```
Use `require` method of module to specify its dependencies.
```javascript
var unit = gumup.unit('main', implementation);

unit.require('common.foo');
unit.require('utils.bar');

function implementation(units) {
    units.common.foo.myFunc();
    units.utils.bar;
}
```
Hook `gumup.init()` to the page load event.

## Related

Grunt task [grunt-gumup][] for resolving unit dependencies.

[grunt-gumup]: https://github.com/amsemy/grunt-gumup

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