# ender-commonjs

> commonjs module support for ender

Latest version **1.0.8** (published 2015-03-13) · 0 weekly downloads

## Install

```sh
npm install ender-commonjs
pnpm add ender-commonjs
yarn add ender-commonjs
bun add ender-commonjs
```

## 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.8 |
| Published | 2015-03-13 |
| First published | 2013-11-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | amccollum, rvagg, ded, fat, luk, connor |
| Keywords | ender, modules, commonjs |

## Links

- npm: https://www.npmjs.com/package/ender-commonjs
- Homepage: http://enderjs.com
- npm.io page: https://npm.io/package/ender-commonjs

## Recent versions

- 1.0.8 (latest) — 2015-03-13
- 1.0.7 — 2014-02-22
- 1.0.6 — 2014-02-14
- 1.0.4 — 2013-12-11
- 1.0.3 — 2013-11-21
- 1.0.2 — 2013-11-17

## README

# Ender CommonJS
The core client library to Ender providing you with `require`, `provide`, and a `Module` class.

## `require(id)`
``` js
var each = require('underscore').each
var select = require('sizzle')
each(select('h1'), function (el) {
  el.style.color = 'red'
})
```

### `require._modules`
Includes the list of which modules are available for use in your Ender bundle

### `require._cache`
Includes the list of modules that have been `required()` by the implementer.

## `provide (id, value)`
``` js
provide('client/utils', {
  formatNumber: function (num) {
    return String(num).replace(/(\d)(?=(\d{3})+$)/g, '$1,')
  }
})

// access client/utils module
var format = require('client/utils').formatNumber
```

## `Module`
- supports multi-file modules, internal/relative requires, `index` requiring, requiring submodules, and CommonJS compatibility.

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