{"name":"function-once","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/function-once.git"},"description":"Wraps a function so that it's only ever executed once.","version":"3.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["once","function","call"],"devDependencies":{"fava":"^0.2.1","tsex":"^3.0.1","typescript":"^5.1.6"},"gitHead":"d847bbd0a94f01c7e60b5ffa4d802b43757c2722","bugs":{"url":"https://github.com/fabiospampinato/function-once/issues"},"homepage":"https://github.com/fabiospampinato/function-once#readme","_id":"function-once@3.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-WEhgu9PE55sHFf+SBg3lI8+CWpsqReLcsp3g12XhwSJJgnodpSpHk6StvpeVcKuHAFCAdttLrslJRFDSdLDf4g==","shasum":"91bcf26cdad943feb1fa6cebd04c7e2837ab6c53","tarball":"http://registry-npm.ywwl.com/function-once/download/function-once-3.0.0.tgz","fileCount":9,"unpackedSize":3498,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpA3Dq6i0hbnmbTg4QHARVcLfBIKBeTYoOzOl04Y/IhAiBgsty8U5I6WYMoQB4NsVD1NGHMnKDulqeMVaayjtVq/A=="}],"size":1982,"noattachment":false,"key":"/function-once/-/function-once-3.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/function-once_3.0.0_1691601253877_0.9103195283911292"},"_hasShrinkwrap":false,"readme":"# Function Once\n\nWraps a function so that it's only ever executed once.\n\nNote: `this` is always set to `undefined` and only functions that don't accept any arguments are supported, as using those with a function that's only ever executed once is practically just a footgun. If you need different `this` or different arguments you should probably use memoization instead.\n\n## Install\n\n```sh\nnpm install --save function-once\n```\n\n## Usage\n\n```ts\nimport once from 'function-once';\n\nconst rand = once (() => Math.random ());\n\nrand (); // => 0.3344627371267874\nrand (); // => 0.3344627371267874\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1691601254039,"_cnpm_publish_time":1691601254039,"dist-tags":{"latest":"3.0.1"}}