# rewrite-js-dependencies

> Rewrite JS Dependencies

Latest version **1.1.1** (published 2014-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install rewrite-js-dependencies
pnpm add rewrite-js-dependencies
yarn add rewrite-js-dependencies
bun add rewrite-js-dependencies
```

## 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.1.1 |
| Published | 2014-12-02 |
| First published | 2014-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jonathan Ong |
| Maintainers | jongleberry |
| Keywords | dependencies, js, rewrite, es6, module, commonjs |

## Links

- npm: https://www.npmjs.com/package/rewrite-js-dependencies
- Repository: https://github.com/webdeps/rewrite-js-dependencies
- Issues: https://github.com/webdeps/rewrite-js-dependencies/issues
- npm.io page: https://npm.io/package/rewrite-js-dependencies

## Dependencies (9)

- [mz](https://npm.io/package/mz.md) 1
- [debug](https://npm.io/package/debug.md) *
- [slave](https://npm.io/package/slave.md) 1
- [mkdirp](https://npm.io/package/mkdirp.md) 0
- [recast](https://npm.io/package/recast.md) 0
- [esprima-fb](https://npm.io/package/esprima-fb.md) *
- [native-or-bluebird](https://npm.io/package/native-or-bluebird.md) 1
- [es6-module-crosspiler](https://npm.io/package/es6-module-crosspiler.md) 2
- [esprima-error-formatter](https://npm.io/package/esprima-error-formatter.md) 1

## 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.1.1 (latest) — 2014-12-02
- 1.1.0 — 2014-12-02
- 1.0.2 — 2014-11-22
- 1.0.1 — 2014-08-29
- 1.0.0 — 2014-08-22
- 0.0.0 — 2014-08-22

## README

# rewrite-js-dependencies

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]

Rewrite your JS dependencies using [es6-module-crosspiler](https://github.com/polyfills/es6-module-crosspiler).
Supports rewriting both ES6 modules as well as CommonJS modules.
You may optionally run everything in a separate child process to avoid
killing your event queue with crazy AST stuff!

## API

### rewrite(string, renames).then( out => )

```js
var rewrite = require('rewrite-js-dependencies')

rewrite('import "a";', {
  a: 'b'
}).then(function (val) {
  assert.equal(val, 'import "b";')
})
```

### Using child processes

Child processes are supported via [slave](https://github.com/thenables/slave).
To use child processes:

```js
// run all the logic in a different process
var rewrite = require('rewrite-js-dependencies/master')
// spin up a second child process
rewrite.fork()
// spin up a third
rewrite.fork()

rewrite('import "a";', {
  a: 'b'
}).then(function (val) {
  assert.equal(val, 'import "b";')
})
```

[npm-image]: https://img.shields.io/npm/v/rewrite-js-dependencies.svg?style=flat-square
[npm-url]: https://npmjs.org/package/rewrite-js-dependencies
[github-tag]: http://img.shields.io/github/tag/webdeps/rewrite-js-dependencies.svg?style=flat-square
[github-url]: https://github.com/webdeps/rewrite-js-dependencies/tags
[travis-image]: https://img.shields.io/travis/webdeps/rewrite-js-dependencies.svg?style=flat-square
[travis-url]: https://travis-ci.org/webdeps/rewrite-js-dependencies
[coveralls-image]: https://img.shields.io/coveralls/webdeps/rewrite-js-dependencies.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/webdeps/rewrite-js-dependencies?branch=master
[david-image]: http://img.shields.io/david/webdeps/rewrite-js-dependencies.svg?style=flat-square
[david-url]: https://david-dm.org/webdeps/rewrite-js-dependencies
[license-image]: http://img.shields.io/npm/l/rewrite-js-dependencies.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/rewrite-js-dependencies.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/rewrite-js-dependencies
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/

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