{
  "manifest": {
    "name": "@rollup/pluginutils",
    "version": "3.1.0",
    "publishConfig": {
      "access": "public"
    },
    "description": "A set of utility functions commonly used by Rollup plugins",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/rollup/plugins.git"
    },
    "author": {
      "name": "Rich Harris",
      "email": "richard.a.harris@gmail.com"
    },
    "homepage": "https://github.com/rollup/plugins/tree/master/packages/pluginutils#readme",
    "bugs": {
      "url": "https://github.com/rollup/plugins/issues"
    },
    "main": "./dist/cjs/index.js",
    "engines": {
      "node": ">= 8.0.0"
    },
    "scripts": {
      "build": "rollup -c",
      "ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
      "ci:lint": "pnpm run build && pnpm run lint",
      "ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
      "ci:test": "pnpm run test -- --verbose",
      "lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
      "lint:docs": "prettier --single-quote --write README.md",
      "lint:js": "eslint --fix --cache src test types --ext .js,.ts",
      "lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
      "prebuild": "del-cli dist",
      "prepare": "pnpm run build",
      "prepublishOnly": "pnpm run lint && pnpm run build",
      "pretest": "pnpm run build -- --sourcemap",
      "test": "ava"
    },
    "files": [
      "dist",
      "types",
      "README.md",
      "LICENSE"
    ],
    "keywords": [
      "rollup",
      "plugin",
      "utils"
    ],
    "peerDependencies": {
      "rollup": "^1.20.0||^2.0.0"
    },
    "dependencies": {
      "@types/estree": "0.0.39",
      "estree-walker": "^1.0.1",
      "picomatch": "^2.2.2"
    },
    "devDependencies": {
      "@rollup/plugin-commonjs": "^11.0.2",
      "@rollup/plugin-node-resolve": "^7.1.1",
      "@rollup/plugin-typescript": "^3.0.0",
      "@types/jest": "^24.9.0",
      "@types/node": "^12.12.25",
      "@types/picomatch": "^2.2.1",
      "typescript": "^3.7.5"
    },
    "ava": {
      "compileEnhancements": false,
      "extensions": [
        "ts"
      ],
      "require": [
        "ts-node/register"
      ],
      "files": [
        "!**/fixtures/**",
        "!**/helpers/**",
        "!**/recipes/**",
        "!**/types.ts"
      ]
    },
    "exports": {
      "require": "./dist/cjs/index.js",
      "import": "./dist/es/index.js"
    },
    "module": "./dist/es/index.js",
    "nyc": {
      "extension": [
        ".js",
        ".ts"
      ]
    },
    "type": "commonjs",
    "types": "types/index.d.ts",
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-@rollup-pluginutils-3.1.0-706b4524ee6dc8b103b3c995533e5ad680c02b9b-integrity/node_modules/@rollup/pluginutils/package.json",
    "readmeFilename": "README.md",
    "readme": "[npm]: https://img.shields.io/npm/v/@rollup/pluginutils\n[npm-url]: https://www.npmjs.com/package/@rollup/pluginutils\n[size]: https://packagephobia.now.sh/badge?p=@rollup/pluginutils\n[size-url]: https://packagephobia.now.sh/result?p=@rollup/pluginutils\n\n[![npm][npm]][npm-url]\n[![size][size]][size-url]\n[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)\n\n# @rollup/pluginutils\n\nA set of utility functions commonly used by 🍣 Rollup plugins.\n\n## Requirements\n\nThis plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.\n\n## Install\n\nUsing npm:\n\n```console\nnpm install @rollup/pluginutils --save-dev\n```\n\n## Usage\n\n```js\nimport utils from '@rollup/pluginutils';\n//...\n```\n\n## API\n\nAvailable utility functions are listed below:\n\n_Note: Parameter names immediately followed by a `?` indicate that the parameter is optional._\n\n### addExtension\n\nAdds an extension to a module ID if one does not exist.\n\nParameters: `(filename: String, ext?: String)`<br>\nReturns: `String`\n\n```js\nimport { addExtension } from '@rollup/pluginutils';\n\nexport default function myPlugin(options = {}) {\n  return {\n    resolveId(code, id) {\n      // only adds an extension if there isn't one already\n      id = addExtension(id); // `foo` -> `foo.js`, `foo.js -> foo.js`\n      id = addExtension(id, '.myext'); // `foo` -> `foo.myext`, `foo.js -> `foo.js`\n    }\n  };\n}\n```\n\n### attachScopes\n\nAttaches `Scope` objects to the relevant nodes of an AST. Each `Scope` object has a `scope.contains(name)` method that returns `true` if a given name is defined in the current scope or a parent scope.\n\nParameters: `(ast: Node, propertyName?: String)`<br>\nReturns: `Object`\n\nSee [rollup-plugin-inject](https://github.com/rollup/rollup-plugin-inject) or [rollup-plugin-commonjs](https://github.com/rollup/rollup-plugin-commonjs) for an example of usage.\n\n```js\nimport { attachScopes } from '@rollup/pluginutils';\nimport { walk } from 'estree-walker';\n\nexport default function myPlugin(options = {}) {\n  return {\n    transform(code) {\n      const ast = this.parse(code);\n\n      let scope = attachScopes(ast, 'scope');\n\n      walk(ast, {\n        enter(node) {\n          if (node.scope) scope = node.scope;\n\n          if (!scope.contains('foo')) {\n            // `foo` is not defined, so if we encounter it,\n            // we assume it's a global\n          }\n        },\n        leave(node) {\n          if (node.scope) scope = scope.parent;\n        }\n      });\n    }\n  };\n}\n```\n\n### createFilter\n\nConstructs a filter function which can be used to determine whether or not certain modules should be operated upon.\n\nParameters: `(include?: <minmatch>, exclude?: <minmatch>, options?: Object)`<br>\nReturns: `String`\n\n#### `include` and `exclude`\n\nType: `String | RegExp | Array[...String|RegExp]`<br>\n\nA valid [`minimatch`](https://www.npmjs.com/package/minimatch) pattern, or array of patterns. If `options.include` is omitted or has zero length, filter will return `true` by default. Otherwise, an ID must match one or more of the `minimatch` patterns, and must not match any of the `options.exclude` patterns.\n\n#### `options`\n\n##### `resolve`\n\nType: `String | Boolean | null`\n\nOptionally resolves the patterns against a directory other than `process.cwd()`. If a `String` is specified, then the value will be used as the base directory. Relative paths will be resolved against `process.cwd()` first. If `false`, then the patterns will not be resolved against any directory. This can be useful if you want to create a filter for virtual module names.\n\n#### Usage\n\n```js\nimport { createFilter } from '@rollup/pluginutils';\n\nexport default function myPlugin(options = {}) {\n  // assume that the myPlugin accepts options of `options.include` and `options.exclude`\n  var filter = createFilter(options.include, options.exclude, {\n    resolve: '/my/base/dir'\n  });\n\n  return {\n    transform(code, id) {\n      if (!filter(id)) return;\n\n      // proceed with the transformation...\n    }\n  };\n}\n```\n\n### dataToEsm\n\nTransforms objects into tree-shakable ES Module imports.\n\nParameters: `(data: Object)`<br>\nReturns: `String`\n\n#### `data`\n\nType: `Object`\n\nAn object to transform into an ES module.\n\n#### Usage\n\n```js\nimport { dataToEsm } from '@rollup/pluginutils';\n\nconst esModuleSource = dataToEsm(\n  {\n    custom: 'data',\n    to: ['treeshake']\n  },\n  {\n    compact: false,\n    indent: '\\t',\n    preferConst: false,\n    objectShorthand: false,\n    namedExports: true\n  }\n);\n/*\nOutputs the string ES module source:\n  export const custom = 'data';\n  export const to = ['treeshake'];\n  export default { custom, to };\n*/\n```\n\n### extractAssignedNames\n\nExtracts the names of all assignment targets based upon specified patterns.\n\nParameters: `(param: Node)`<br>\nReturns: `Array[...String]`\n\n#### `param`\n\nType: `Node`\n\nAn `acorn` AST Node.\n\n#### Usage\n\n```js\nimport { extractAssignedNames } from '@rollup/pluginutils';\nimport { walk } from 'estree-walker';\n\nexport default function myPlugin(options = {}) {\n  return {\n    transform(code) {\n      const ast = this.parse(code);\n\n      walk(ast, {\n        enter(node) {\n          if (node.type === 'VariableDeclarator') {\n            const declaredNames = extractAssignedNames(node.id);\n            // do something with the declared names\n            // e.g. for `const {x, y: z} = ... => declaredNames = ['x', 'z']\n          }\n        }\n      });\n    }\n  };\n}\n```\n\n### makeLegalIdentifier\n\nConstructs a bundle-safe identifier from a `String`.\n\nParameters: `(str: String)`<br>\nReturns: `String`\n\n#### Usage\n\n```js\nimport { makeLegalIdentifier } from '@rollup/pluginutils';\n\nmakeLegalIdentifier('foo-bar'); // 'foo_bar'\nmakeLegalIdentifier('typeof'); // '_typeof'\n```\n\n## Meta\n\n[CONTRIBUTING](/.github/CONTRIBUTING.md)\n\n[LICENSE (MIT)](/LICENSE)\n",
    "licenseText": "The MIT License (MIT)\n\nCopyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
    "hash": "706b4524ee6dc8b103b3c995533e5ad680c02b9b",
    "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
    "registry": "npm",
    "packageName": "@rollup/pluginutils",
    "cacheIntegrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s="
  },
  "registry": "npm",
  "hash": "706b4524ee6dc8b103b3c995533e5ad680c02b9b"
}