# re-require

> find the require calls and change them

Latest version **0.0.1** (published 2014-05-14) · mit license · 0 weekly downloads

## Install

```sh
npm install re-require
pnpm add re-require
yarn add re-require
bun add re-require
```

## 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.0.1 |
| Published | 2014-05-14 |
| First published | 2014-05-14 |
| Weekly downloads | 0 |
| License | mit |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chevett |

## Links

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

## Dependencies (3)

- [merle](https://npm.io/package/merle.md) ^0.1.5
- [esprima](https://npm.io/package/esprima.md) ^1.2.1
- [escodegen](https://npm.io/package/escodegen.md) ^1.3.2

## Recent versions

- 0.0.1 (latest) — 2014-05-14
- 0.0.0 — 2014-05-14

## README

re-require [![Build Status](https://travis-ci.org/chevett/re-require.png)](https://travis-ci.org/chevett/re-require)
=========

find some require statements and maybe change them if you feel like it


```js
var rerequire = require('re-require');
var fs = require('fs');
var strOldCode = fs.readFileSync('./your-killer-module.js', 'utf-8');

var strNewCode = rerequire(strOldCode, function(arg){
  // if there is a single string argument to the require call 
  // then it be passed to the callback as the only parameter.
  console.dir(arg);

  // this.value is the esprima node for a require call.
  // you can change it by overwriting or modifying this.value
  console.dir(this.value);
});
```

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