# rename-function-calls

> Renames functions calls, but leaves function definitions unchanged.

Latest version **0.1.1** (published 2014-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install rename-function-calls
pnpm add rename-function-calls
yarn add rename-function-calls
bun add rename-function-calls
```

## 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.1 |
| Published | 2014-07-20 |
| First published | 2014-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Thorsten Lorenz |
| Maintainers | thlorenz |
| Keywords | replace, refactor, debug, function, AST |

## Links

- npm: https://www.npmjs.com/package/rename-function-calls
- Repository: https://github.com/thlorenz/rename-function-calls
- Issues: https://github.com/thlorenz/rename-function-calls/issues
- npm.io page: https://npm.io/package/rename-function-calls

## Dependencies (1)

- [detective](https://npm.io/package/detective.md) ~3.1.0

## 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.1 (latest) — 2014-07-20
- 0.1.0 — 2014-02-26

## README

# rename-function-calls [![build status](https://secure.travis-ci.org/thlorenz/rename-function-calls.png)](http://travis-ci.org/thlorenz/rename-function-calls)

Renames functions calls, but leaves function definitions unchanged.

```js
var code = [ 
    'function log(s)   { console.error(s); }'
  , 'function print(s) { console.log(s); }'
  , 'print(\'hello\');'
  , 'log(\'world\');'
].join('\n')

var rename = require('rename-function-call');
var renamed = rename('log', 'print', code)
console.log(renamed);
```

```
function log(s)   { console.error(s); }
function print(s) { console.log(s); }
print('hello');
print('world');
```
## Installation

    npm install rename-function-calls

## API

<!-- START docme generated API please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN docme TO UPDATE -->

<div>
<div class="jsdoc-githubify">
<section>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<dl>
<dt>
<h4 class="name" id="rename"><span class="type-signature"></span>rename<span class="signature">(origSrc, fromName, toName)</span><span class="type-signature"> &rarr; {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Replaces every function call named <code>from</code> with another one that is named <code>to</code>.</p>
<h4>Example</h4>
<p>   rename(src, 'log', 'print');
// =&gt; log(x) becomes print(x)</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>origSrc</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>the original source</p></td>
</tr>
<tr>
<td class="name"><code>fromName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>name under which function is currently called</p></td>
</tr>
<tr>
<td class="name"><code>toName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>name to which the function calls should be renamed</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy">
<li>
<a href="https://github.com/thlorenz/rename-function-calls/blob/master/index.js">index.js</a>
<span>, </span>
<a href="https://github.com/thlorenz/rename-function-calls/blob/master/index.js#L23">lineno 23</a>
</li>
</ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>source with function calls renamed</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>

*generated with [docme](https://github.com/thlorenz/docme)*
</div>
<!-- END docme generated API please keep comment here to allow auto update -->

## License

MIT

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