{"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.","license":"MIT","version":"3.0.1","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.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"function-once@3.0.1","gitHead":"06f643f3b2c28a0a0da8915677f3ae8d4dffc138","bugs":{"url":"https://github.com/fabiospampinato/function-once/issues"},"homepage":"https://github.com/fabiospampinato/function-once#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-bE3E8REk4jANDot3l0sLFkXgywBwzFKsmbwdnVHLJUnt/3kV6dNG0oJJqoRBuS1Z9Lr4ZoQgwV0ZNLDgWDbv7Q==","shasum":"162b9ad8800f53b2e4a1c8d752d8054b4b05423a","tarball":"http://registry-npm.ywwl.com/function-once/download/function-once-3.0.1.tgz","fileCount":5,"unpackedSize":2794,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmAHBGsxVDUCHCn45BVZjFBmiX+lUT7vxnzTlIHGLY0AIhAIQ619jbZ0bGs84bajWKnwxWsBY5dFYpZqYYGoRa+A3d"}],"size":1650,"noattachment":false,"key":"/function-once/-/function-once-3.0.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/function-once_3.0.1_1737073702155_0.6480382974256995"},"_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 function-once\n```\n\n## Usage\n\n```ts\nimport once from 'function-once';\n\n// Let's make sure a function is at most executed only 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":1737073702343,"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1737073702343,"dist-tags":{"latest":"3.0.1"}}