{
  "manifest": {
    "name": "onetime",
    "version": "5.1.2",
    "description": "Ensure a function is only called once",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/sindresorhus/onetime.git"
    },
    "funding": "https://github.com/sponsors/sindresorhus",
    "author": {
      "name": "Sindre Sorhus",
      "email": "sindresorhus@gmail.com",
      "url": "https://sindresorhus.com"
    },
    "engines": {
      "node": ">=6"
    },
    "scripts": {
      "test": "xo && ava && tsd"
    },
    "files": [
      "index.js",
      "index.d.ts"
    ],
    "keywords": [
      "once",
      "function",
      "one",
      "onetime",
      "func",
      "fn",
      "single",
      "call",
      "called",
      "prevent"
    ],
    "dependencies": {
      "mimic-fn": "^2.1.0"
    },
    "devDependencies": {
      "ava": "^1.4.1",
      "tsd": "^0.7.1",
      "xo": "^0.24.0"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-onetime-5.1.2-d0e96ebb56b07476df1dd9c4806e5237985ca45e-integrity/node_modules/onetime/package.json",
    "readmeFilename": "readme.md",
    "readme": "# onetime [![Build Status](https://travis-ci.com/sindresorhus/onetime.svg?branch=master)](https://travis-ci.com/github/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 and extending `Function.prototype`.*\n\n## Install\n\n```\n$ npm install onetime\n```\n\n## Usage\n\n```js\nconst onetime = require('onetime');\n\nlet i = 0;\n\nconst foo = onetime(() => ++i);\n\nfoo(); //=> 1\nfoo(); //=> 1\nfoo(); //=> 1\n\nonetime.callCount(foo); //=> 3\n```\n\n```js\nconst onetime = require('onetime');\n\nconst foo = onetime(() => {}, {throw: true});\n\nfoo();\n\nfoo();\n//=> Error: Function `foo` can only be called once\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`\\\nDefault: `false`\n\nThrow an error when called more than once.\n\n### onetime.callCount(fn)\n\nReturns a number representing how many times `fn` has been called.\n\nNote: It throws an error if you pass in a function that is not wrapped by `onetime`.\n\n```js\nconst onetime = require('onetime');\n\nconst foo = onetime(() => {});\n\nfoo();\nfoo();\nfoo();\n\nconsole.log(onetime.callCount(foo));\n//=> 3\n```\n\n#### fn\n\nType: `Function`\n\nFunction to get call count from.\n\n## onetime for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n",
    "licenseText": "MIT License\n\nCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz",
    "hash": "d0e96ebb56b07476df1dd9c4806e5237985ca45e",
    "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
    "registry": "npm",
    "packageName": "onetime",
    "cacheIntegrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4="
  },
  "registry": "npm",
  "hash": "d0e96ebb56b07476df1dd9c4806e5237985ca45e"
}