# modula

> Dead simple library which helpes with modalar testing. Provides Node.js's require replacement. Designed to work with Karma test runner.

Latest version **0.2.0** (published 2013-10-16) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2013-10-16 |
| First published | 2013-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sasha Koss |
| Maintainers | kossnocorp |

## Links

- npm: https://www.npmjs.com/package/modula
- npm.io page: https://npm.io/package/modula

## Recent versions

- 0.2.0 (latest) — 2013-10-16
- 0.1.0 — 2013-10-14

## README

# Modula.js

![](https://api.travis-ci.org/kossnocorp/modula.png)

Modula is dead simple library which helps with modular testing. I was needed it
for Node.js's require replacement to use with [Karma test runner](http://karma-runner.github.io/).

## Usage

1. Define module:

  ``` coffeescript
  # ...

  if modula?
    modula.export('lisn', Lisn)
  else if module?
    module.exports = Lisn
  else
    window.Lisn = Lisn
  ```

2. Use it in specs:

  ``` coffeescript
  Lisn = require('lisn')

  # ...
  ```

3. That's it!

### Installation

`modula` avaliable as **[npm](https://npmjs.org/package/modula)** and **bower** json.

### API

#### `modula`

`modula` is a global namespace.

#### `modula.export(name, exports)`

Saves `exports` associated with passed module `name`.

``` coffeescript
modula.export('backbone', Backbone)
```

#### `modula.require(name)`

Returns module associated with `name`. Also avaliable as `window.require`.

``` coffeescript
Backbone = require('backbone')
```

If module is not found, modula will throw exception.

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