# slice-arguments

> slice arguments and common helpers

Latest version **0.0.1** (published 2013-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install slice-arguments
pnpm add slice-arguments
yarn add slice-arguments
bun add slice-arguments
```

## 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 | 2013-11-29 |
| First published | 2013-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | stagas |
| Maintainers | stagas |
| Keywords | slice, arguments, callback, decorate |

## Links

- npm: https://www.npmjs.com/package/slice-arguments
- npm.io page: https://npm.io/package/slice-arguments

## Dependencies (2)

- [merge](https://npm.io/package/merge.md) jkroso/merge#npm
- [sliced](https://npm.io/package/sliced.md) *

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-11-29

## README

# slice-arguments

slice arguments and common helpers

## Installing

`npm install slice-arguments`

`component install stagas/slice-arguments`

## Example

```js
var slice = require('slice-arguments');

function foo(){
  var args = slice.call(arguments); // or just: slice(arguments)

  // get all values except callback if present
  console.log(args.values()); // => [ 'Hello' ]

  // get the callback if present
  console.log(args.callback()); // => [Function]

  // decorate callback
  var fn = args.callback(function(s){
    fn(s + '!');
  });

  bar.apply(this, args);
}

function bar(s, fn){
  fn(s + ', world');
}

foo('Hello', function(res){
  console.log(res); // => Hello, world!
});
```

## API

### slice(arguments)
### slice.call(arguments)

Returns arguments in an array.

### .callback([fn])

Returns the callback if present, or a noop
function, and optionally replaces with `fn`.

### .values()

Returns the arguments minus the callback
if present.

## License

MIT

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