# simple-swizzle

> Simply swizzle your arguments

Latest version **0.2.4** (published 2025-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-swizzle
pnpm add simple-swizzle
yarn add simple-swizzle
bun add simple-swizzle
```

## Health

**Score 33/100 (F)** — status: maintenance-mode.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2025-09-13 |
| First published | 2016-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/simple-swizzle) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Qix |
| Maintainers | qix |
| Keywords | argument, arguments, swizzle, swizzling, parameter, parameters, mixed, array |

## Links

- npm: https://www.npmjs.com/package/simple-swizzle
- Repository: https://github.com/qix-/node-simple-swizzle
- Homepage: https://github.com/qix-/node-simple-swizzle#readme
- Issues: https://github.com/qix-/node-simple-swizzle/issues
- npm.io page: https://npm.io/package/simple-swizzle

## Dependencies (1)

- [is-arrayish](https://npm.io/package/is-arrayish.md) ^0.3.1

## Recent versions

- 0.2.4 (latest) — 2025-09-13
- 0.2.2 — 2016-11-16
- 0.2.1 — 2016-01-23
- 0.2.0 — 2016-01-21
- 0.1.0 — 2016-01-20

## README

> **NOTE:** ⚠️ **Don't use this package in new projects.** It is a **huge anti-pattern** and will only confuse and annoy people who use whatever code you write with it. I wrote this in a time when Javascript and Node.js were still pretty experimental and clever things like this weren't frowned upon. I've also learned a LOT about proper API design since I wrote this package. DO. NOT. USE. THIS. PACKAGE. If you're reaching for it, please *really* reconsider your API's design.

---

# simple-swizzle [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-simple-swizzle.svg?style=flat-square)](https://travis-ci.org/Qix-/node-simple-swizzle) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-simple-swizzle.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-simple-swizzle)

> [Swizzle](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)) your function arguments; pass in mixed arrays/values and get a clean array

## Usage

```js
var swizzle = require('simple-swizzle');

function myFunc() {
	var args = swizzle(arguments);
	// ...
	return args;
}

myFunc(1, [2, 3], 4); // [1, 2, 3, 4]
myFunc(1, 2, 3, 4);   // [1, 2, 3, 4]
myFunc([1, 2, 3, 4]); // [1, 2, 3, 4]
```

Functions can also be wrapped to automatically swizzle arguments and be passed
the resulting array.

```js
var swizzle = require('simple-swizzle');

var swizzledFn = swizzle.wrap(function (args) {
	// ...
	return args;
});

swizzledFn(1, [2, 3], 4); // [1, 2, 3, 4]
swizzledFn(1, 2, 3, 4);   // [1, 2, 3, 4]
swizzledFn([1, 2, 3, 4]); // [1, 2, 3, 4]
```

## License
Licensed under the [MIT License](http://opensource.org/licenses/MIT).
You can find a copy of it in [LICENSE](LICENSE).

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