# aster-commonjs

> Bundle CommonJS with aster.

Latest version **0.1.0** (published 2014-10-15) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2014-10-15 |
| First published | 2014-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ingvar Stepanyan |
| Maintainers | rreverser |
| Keywords | aster-plugin, ast, javascript, commonjs, bundle |

## Links

- npm: https://www.npmjs.com/package/aster-commonjs
- Repository: https://github.com/asterjs/aster-commonjs
- Issues: https://github.com/asterjs/aster-commonjs/issues
- npm.io page: https://npm.io/package/aster-commonjs

## Dependencies (3)

- [davy](https://npm.io/package/davy.md) ^0.3.3
- [pure-cjs](https://npm.io/package/pure-cjs.md) ^1.15.0
- [aster-src](https://npm.io/package/aster-src.md) ^0.1.3

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-10-15

## README

# aster-commonjs
[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]

> Bundle CommonJS with aster.

## Usage

First, install `aster-commonjs` as a development dependency:

```shell
npm install --save-dev aster-commonjs
```

Then, add it to your build script:

```javascript
var aster = require('aster');
var commonjs = require('aster-commonjs');

aster.src('src/**/*.js')
.map(commonjs({
  input: 'src/index.js'
}))
.map(aster.dest('dist'))
.subscribe(aster.runner);
```

## API

### commonjs(options)

* `input`: `String` | `Function()`. <br />
  Input file.<br />
  Example: `'superLib/topModule.js'`

* `output`: `String` | `Function(input)`<br />
  Output file.<br />
  Default: `input => input.replace(/(\.js)?$/, '.out.js')`

* `external`: `{ cjsName: (true | { amd?: String, global?: String }) }`<br />
  External dependencies (to be excluded from bundling). Example:
  ```javascript
  {
    jquery: true,
    lodash: {amd: '../vendor/lodash.js', global: '_'}
  }
  ```

* `exports`: `String` | `Function(input, output)`<br />
  Export top module with [UMD](https://github.com/umdjs/umd) with given global object name.<br />
  Default: no exports.

* `defaultExt`: `String`<br />
  Default extension for require calls (`"js"`).

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)

[npm-url]: https://npmjs.org/package/aster-commonjs
[npm-image]: https://badge.fury.io/js/aster-commonjs.png

[travis-url]: http://travis-ci.org/asterjs/aster-commonjs
[travis-image]: https://secure.travis-ci.org/asterjs/aster-commonjs.png?branch=master

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