{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["once","function","one","onetime","func","fn","single","call","called","prevent"],"dist-tags":{"latest":"2.0.1"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Ensure a function is only called once","readme":"# onetime [![Build Status](https://travis-ci.org/sindresorhus/onetime.svg?branch=master)](https://travis-ci.org/sindresorhus/onetime)\n\n> Ensure a function is only called once\n\nWhen called multiple times it will return the return value from the first call.\n\n*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty extending `Function.prototype`.*\n\n\n## Install\n\n```\n$ npm install --save onetime\n```\n\n\n## Usage\n\n```js\nlet i = 0;\n\nconst foo = onetime(() => i++);\n\nfoo(); //=> 0\nfoo(); //=> 0\nfoo(); //=> 0\n```\n\n```js\nconst foo = onetime(() => {}, {throw: true});\n\nfoo();\n\nfoo();\n//=> Error: Function `foo` can only be called once\n```\n\n\n## API\n\n### onetime(fn, [options])\n\nReturns a function that only calls `fn` once.\n\n#### fn\n\nType: `Function`\n\nFunction that should only be called once.\n\n#### options\n\nType: `Object`\n\n##### throw\n\nType: `boolean`<br>\nDefault: `false`\n\nThrow an error when called more than once.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sindresorhus/onetime.git"},"users":{"schnittstabil":true,"n370":true,"anhulife":true,"quocnguyen":true,"rocket0191":true},"bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"license":"MIT","versions":{"0.1.0":{"name":"onetime","version":"0.1.0","description":"Only call a function once. Unlike the module `once`, this one isn't naughty extending `Function.prototype`.","keywords":["once","one","single","call","function","prevent"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["onetime.js"],"main":"onetime.js","repository":{"type":"git","url":"git://github.com/sindresorhus/onetime"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"~1.x"},"engines":{"node":">=0.8.0"},"bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime","_id":"onetime@0.1.0","dist":{"shasum":"971beb7a622f1396b9cf4ef7277262f2b01c8565","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"0.1.1":{"name":"onetime","version":"0.1.1","description":"Only call a function once. Unlike the module `once`, this one isn't naughty extending `Function.prototype`.","keywords":["once","one","single","call","function","prevent"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["onetime.js"],"main":"onetime.js","repository":{"type":"git","url":"git://github.com/sindresorhus/onetime"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"engines":{"node":">=0.8.0"},"bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime","_id":"onetime@0.1.1","dist":{"shasum":"f4204dc15a47f80c43779340d093ad786c1bab21","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"1.0.0":{"name":"onetime","version":"1.0.0","description":"Only call a function once. Unlike the module `once`, this one isn't naughty extending `Function.prototype`.","keywords":["once","one","single","call","function","prevent"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["index.js"],"repository":{"type":"git","url":"git://github.com/sindresorhus/onetime"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"engines":{"node":">=0.10.0"},"gitHead":"a4aa1ce5291cc5f32ecb8f4b0a918b12cb47ea5e","bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime","_id":"onetime@1.0.0","_shasum":"3a08a8e39d7816df52d34886374fb8ed8b651f62","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"3a08a8e39d7816df52d34886374fb8ed8b651f62","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-1.0.0.tgz"},"directories":{}},"1.1.0":{"name":"onetime","version":"1.1.0","description":"Only call a function once","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/onetime"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["once","one","single","call","function","prevent"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"6fae2fb77b95b49719d1c270d8ba07d9515bdfe8","bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime","_id":"onetime@1.1.0","_shasum":"a1f7838f8314c516f05ecefcbc4ccfe04b4ed789","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a1f7838f8314c516f05ecefcbc4ccfe04b4ed789","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"2.0.0":{"name":"onetime","version":"2.0.0","description":"Ensure a function is only called once","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/onetime.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["once","function","one","onetime","func","fn","single","call","called","prevent"],"dependencies":{"mimic-fn":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"bb498adb2da79e62b923173480803a9c6f759766","bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime#readme","_id":"onetime@2.0.0","_shasum":"52aa8110e52fc5126ffc667bd8ec21c2ed209ce6","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"52aa8110e52fc5126ffc667bd8ec21c2ed209ce6","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onetime-2.0.0.tgz_1476902515797_0.18329595238901675"},"directories":{}},"2.0.1":{"name":"onetime","version":"2.0.1","description":"Ensure a function is only called once","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/onetime.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["once","function","one","onetime","func","fn","single","call","called","prevent"],"dependencies":{"mimic-fn":"^1.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"32bca382f5934c8fe7fd78bcef9ad16b3474948f","bugs":{"url":"https://github.com/sindresorhus/onetime/issues"},"homepage":"https://github.com/sindresorhus/onetime#readme","_id":"onetime@2.0.1","_shasum":"067428230fd67443b2794b22bba528b6867962d4","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"067428230fd67443b2794b22bba528b6867962d4","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/onetime/-/onetime-2.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/onetime-2.0.1.tgz_1489980257371_0.244376125279814"},"directories":{}}},"name":"onetime","time":{"modified":"2017-03-20T03:24:17.619Z","created":"2013-12-13T21:20:15.964Z","0.1.0":"2013-12-13T21:20:18.951Z","0.1.1":"2014-04-30T22:39:14.004Z","1.0.0":"2014-08-13T17:03:51.426Z","1.1.0":"2015-12-18T00:30:55.390Z","2.0.0":"2016-10-19T18:41:56.004Z","2.0.1":"2017-03-20T03:24:17.619Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/onetime#readme"}