# rename-function-x

> Rename a function.

Latest version **1.1.2** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2019-08-28 |
| First published | 2019-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.11.4 |
| Dependencies | 7 |
| Unpacked size | 330.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Graham Fairweather |
| Maintainers | xotic750 |
| Keywords | rename, function, module, javascript, nodejs, browser |

## Links

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

## Dependencies (7)

- [attempt-x](https://npm.io/package/attempt-x.md) ^2.1.2
- [is-var-name](https://npm.io/package/is-var-name.md) ^2.0.0
- [to-string-x](https://npm.io/package/to-string-x.md) ^2.1.1
- [to-boolean-x](https://npm.io/package/to-boolean-x.md) ^2.1.1
- [assert-is-function-x](https://npm.io/package/assert-is-function-x.md) ^3.1.2
- [object-define-property-x](https://npm.io/package/object-define-property-x.md) ^5.1.2
- [object-get-own-property-descriptor-x](https://npm.io/package/object-get-own-property-descriptor-x.md) ^4.1.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2019-08-28
- 1.1.1 — 2019-08-20
- 1.1.0 — 2019-08-14
- 1.0.2 — 2019-08-05
- 1.0.1 — 2019-08-04
- 1.0.0 — 2019-08-04

## README

<a
  href="https://travis-ci.org/Xotic750/rename-function-x"
  title="Travis status">
<img
  src="https://travis-ci.org/Xotic750/rename-function-x.svg?branch=master"
  alt="Travis status" height="18">
</a>
<a
  href="https://david-dm.org/Xotic750/rename-function-x"
  title="Dependency status">
<img src="https://david-dm.org/Xotic750/rename-function-x/status.svg"
  alt="Dependency status" height="18"/>
</a>
<a
  href="https://david-dm.org/Xotic750/rename-function-x?type=dev"
  title="devDependency status">
<img src="https://david-dm.org/Xotic750/rename-function-x/dev-status.svg"
  alt="devDependency status" height="18"/>
</a>
<a
  href="https://badge.fury.io/js/rename-function-x"
  title="npm version">
<img src="https://badge.fury.io/js/rename-function-x.svg"
  alt="npm version" height="18">
</a>
<a
  href="https://www.jsdelivr.com/package/npm/rename-function-x"
  title="jsDelivr hits">
<img src="https://data.jsdelivr.com/v1/package/npm/rename-function-x/badge?style=rounded"
  alt="jsDelivr hits" height="18">
</a>
<a
  href="https://bettercodehub.com/results/Xotic750/rename-function-x"
  title="bettercodehub score">
<img src="https://bettercodehub.com/edge/badge/Xotic750/rename-function-x?branch=master"
  alt="bettercodehub score" height="18">
</a>
<a
  href="https://coveralls.io/github/Xotic750/rename-function-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/rename-function-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

## rename-function-x

Rename a function.

Note: This is not supported in all environments.
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#Browser_compatibility

**Example**

```js
import renameFunction from 'rename-function-x';

const fn = function test() {};
console.log(renameFunction(fn, 'hw')); // true if a success, else false
console.log(fn.name); // hw if set, else test

// The following would normally throw an error as it is a reserved name.
// However, you can for the rename as follows.
console.log(renameFunction(fn, 'catch', true)); // true if a success, else false
```

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