{"_id":"free-context","_rev":"113181","name":"free-context","description":"Free context from a function.","dist-tags":{"latest":"0.0.0"},"maintainers":[{"name":"npm","email":""}],"time":{"modified":"2021-06-03T10:45:44.000Z","created":"2016-12-04T17:12:55.566Z","0.0.0":"2016-12-04T17:12:55.566Z"},"users":{},"author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/free-context.git"},"versions":{"0.0.0":{"name":"free-context","description":"Free context from a function.","version":"0.0.0","homepage":"https://github.com/jamen/free-context","author":{"name":"Jamen Marz","url":"https://git.io/jamen"},"repository":{"type":"git","url":"git+https://github.com/jamen/free-context.git"},"bugs":{"url":"https://github.com/jamen/free-context/issues"},"license":"MIT","engines":{"node":">=4"},"files":["index.js"],"scripts":{"test":"node test"},"keywords":["free","context","method","function","this","apply","call","jamen"],"devDependencies":{"tape":"^4.6.3"},"gitHead":"adaeda36bf362d18a3b9783f1759751218e47232","_id":"free-context@0.0.0","_shasum":"9bfea101ad929764ddb6baa7a9239ea74fb75f28","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"jamen","email":"jamenmarz+npm@gmail.com"},"dist":{"shasum":"9bfea101ad929764ddb6baa7a9239ea74fb75f28","size":1800,"noattachment":false,"key":"/free-context/-/free-context-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/free-context/download/free-context-0.0.0.tgz"},"maintainers":[{"name":"npm","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/free-context-0.0.0.tgz_1480871574900_0.22193082352168858"},"directories":{},"publish_time":1480871575566,"_cnpm_publish_time":1480871575566,"_hasShrinkwrap":false}},"readme":"# free-context\n\n> Free context from a function.\n\n```js\nvar free = require('free-context')\n\n// Free context from `.push` method\nvar push = free(Array.prototype.push)\n\n// First parameter is context, like `.call` or `.apply`\nvar foo = []\npush(foo, 'hello', 'world')\n```\n\n## Installation\n\n```sh\n$ npm install --save free-context\n```\n\n## Usage\n\n### `free(fn, [apply])`\n\nReturns a function you can bind a context to with the first argument.\n\n#### Parameters\n\n - `fn` (`Function`):  Target function for freeing context.  Returns a new contextless version of this.\n - `apply` (`Boolean`): Use array instead of argument list for following parameters.\n\n#### Examples\n\n```js\nvar push = free(Array.prototype.push)\n\nvar foo = []\npush(foo, 'Hello', 'world', 'foo', 'bar')\n```\n\nUsing `apply`:\n\n```js\n// Enable `apply`:\nvar push = free(Array.prototype.push, true)\n\nvar foo = []\nvar items = ['Hello', 'world', 'foo', 'bar']\n\n// Supply array with `apply` instead of arguments\npush(foo, items)\n```\n\n## License\n\nMIT © [Jamen Marz](https://git.io/jamen)\n\n---\n\n[![version](https://img.shields.io/npm/v/free-context.svg?style=flat-square)][package] [![travis](https://img.shields.io/travis/jamen/free-context.svg?style=flat-square)](https://travis-ci.org/jamen/free-context) [![downloads](https://img.shields.io/npm/dt/free-context.svg?style=flat-square)][package] [![license](https://img.shields.io/npm/l/express.svg?style=flat-square)][package] [![follow](https://img.shields.io/github/followers/jamen.svg?style=social&label=Follow)](https://github.com/jamen)\n\n[package]: https://npmjs.org/package/free-context\n","_attachments":{},"homepage":"https://github.com/jamen/free-context","bugs":{"url":"https://github.com/jamen/free-context/issues"},"license":"MIT"}