{"_id":"function-once","_rev":"1-3156be68d4453f00692740ed8932fcf2","name":"function-once","dist-tags":{"latest":"3.0.1"},"versions":{"3.0.0":{"name":"function-once","version":"3.0.0","keywords":["once","function","call"],"_id":"function-once@3.0.0","maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"homepage":"https://github.com/fabiospampinato/function-once#readme","bugs":{"url":"https://github.com/fabiospampinato/function-once/issues"},"dist":{"shasum":"91bcf26cdad943feb1fa6cebd04c7e2837ab6c53","tarball":"https://registry.npmjs.org/function-once/-/function-once-3.0.0.tgz","fileCount":9,"integrity":"sha512-WEhgu9PE55sHFf+SBg3lI8+CWpsqReLcsp3g12XhwSJJgnodpSpHk6StvpeVcKuHAFCAdttLrslJRFDSdLDf4g==","signatures":[{"sig":"MEQCICpA3Dq6i0hbnmbTg4QHARVcLfBIKBeTYoOzOl04Y/IhAiBgsty8U5I6WYMoQB4NsVD1NGHMnKDulqeMVaayjtVq/A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3498},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","gitHead":"d847bbd0a94f01c7e60b5ffa4d802b43757c2722","scripts":{"test":"tsex test","clean":"tsex clean","compile":"tsex compile","test:watch":"tsex test --watch","compile:watch":"tsex compile --watch","prepublishOnly":"tsex prepare"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"repository":{"url":"git+https://github.com/fabiospampinato/function-once.git","type":"git"},"_npmVersion":"8.19.2","description":"Wraps a function so that it's only ever executed once.","directories":{},"_nodeVersion":"18.12.0","_hasShrinkwrap":false,"devDependencies":{"fava":"^0.2.1","tsex":"^3.0.1","typescript":"^5.1.6"},"_npmOperationalInternal":{"tmp":"tmp/function-once_3.0.0_1691601253877_0.9103195283911292","host":"s3://npm-registry-packages"}},"3.0.1":{"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":"https://registry.npmjs.org/function-once/-/function-once-3.0.1.tgz","fileCount":5,"unpackedSize":2794,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmAHBGsxVDUCHCn45BVZjFBmiX+lUT7vxnzTlIHGLY0AIhAIQ619jbZ0bGs84bajWKnwxWsBY5dFYpZqYYGoRa+A3d"}]},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/function-once_3.0.1_1737073702155_0.6480382974256995"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-09T17:14:13.877Z","modified":"2025-01-17T00:28:22.536Z","3.0.0":"2023-08-09T17:14:14.039Z","3.0.1":"2025-01-17T00:28:22.343Z"},"bugs":{"url":"https://github.com/fabiospampinato/function-once/issues"},"homepage":"https://github.com/fabiospampinato/function-once#readme","keywords":["once","function","call"],"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/function-once.git"},"description":"Wraps a function so that it's only ever executed once.","maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"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","readmeFilename":"readme.md","license":"MIT"}