{
  "manifest": {
    "name": "loader-utils",
    "version": "3.2.1",
    "author": {
      "name": "Tobias Koppers @sokra"
    },
    "description": "utils for webpack loaders",
    "dependencies": {},
    "scripts": {
      "lint": "prettier --list-different . && eslint .",
      "pretest": "yarn lint",
      "test": "jest",
      "test:only": "jest --coverage",
      "test:ci": "yarn test:only",
      "release": "yarn test && standard-version"
    },
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/webpack/loader-utils.git"
    },
    "engines": {
      "node": ">= 12.13.0"
    },
    "devDependencies": {
      "coveralls": "^3.1.1",
      "eslint": "^8.0.1",
      "eslint-plugin-node": "^11.1.0",
      "jest": "^27.3.1",
      "prettier": "^2.4.1",
      "standard-version": "^9.3.2"
    },
    "main": "lib/index.js",
    "files": [
      "lib"
    ],
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-loader-utils-3.2.1-4fb104b599daafd82ef3e1a41fb9265f87e1f576-integrity/node_modules/loader-utils/package.json",
    "readmeFilename": "README.md",
    "readme": "# loader-utils\n\n## Methods\n\n### `urlToRequest`\n\nConverts some resource URL to a webpack module request.\n\n> i Before call `urlToRequest` you need call `isUrlRequest` to ensure it is requestable url\n\n```javascript\nconst url = \"path/to/module.js\";\n\nif (loaderUtils.isUrlRequest(url)) {\n  // Logic for requestable url\n  const request = loaderUtils.urlToRequest(url);\n} else {\n  // Logic for not requestable url\n}\n```\n\nSimple example:\n\n```javascript\nconst url = \"path/to/module.js\";\nconst request = loaderUtils.urlToRequest(url); // \"./path/to/module.js\"\n```\n\n#### Module URLs\n\nAny URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path.\n\n```javascript\nconst url = \"~path/to/module.js\";\nconst request = loaderUtils.urlToRequest(url); // \"path/to/module.js\"\n```\n\n#### Root-relative URLs\n\nURLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter:\n\n```javascript\nconst url = \"/path/to/module.js\";\nconst root = \"./root\";\nconst request = loaderUtils.urlToRequest(url, root); // \"./root/path/to/module.js\"\n```\n\nTo convert a root-relative URL into a module URL, specify a `root` value that starts with `~`:\n\n```javascript\nconst url = \"/path/to/module.js\";\nconst root = \"~\";\nconst request = loaderUtils.urlToRequest(url, root); // \"path/to/module.js\"\n```\n\n### `interpolateName`\n\nInterpolates a filename template using multiple placeholders and/or a regular expression.\nThe template and regular expression are set as query params called `name` and `regExp` on the current loader's context.\n\n```javascript\nconst interpolatedName = loaderUtils.interpolateName(\n  loaderContext,\n  name,\n  options\n);\n```\n\nThe following tokens are replaced in the `name` parameter:\n\n- `[ext]` the extension of the resource\n- `[name]` the basename of the resource\n- `[path]` the path of the resource relative to the `context` query parameter or option.\n- `[folder]` the folder the resource is in\n- `[query]` the queryof the resource, i.e. `?foo=bar`\n- `[contenthash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the `xxhash64` hash)\n- `[<hashType>:contenthash:<digestType>:<length>]` optionally one can configure\n  - other `hashType`s, i. e. `xxhash64`, `sha1`, `md4` (wasm version), `native-md4` (`crypto` module version), `md5`, `sha256`, `sha512`\n  - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`\n  - and `length` the length in chars\n- `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the `xxhash64` hash)\n- `[<hashType>:hash:<digestType>:<length>]` optionally one can configure\n  - other `hashType`s, i. e. `xxhash64`, `sha1`, `md4` (wasm version), `native-md4` (`crypto` module version), `md5`, `sha256`, `sha512`\n  - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`\n  - and `length` the length in chars\n- `[N]` the N-th match obtained from matching the current file name against `options.regExp`\n\nIn loader context `[hash]` and `[contenthash]` are the same, but we recommend using `[contenthash]` for avoid misleading.\n\nExamples\n\n```javascript\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\nloaderUtils.interpolateName(loaderContext, \"js/[hash].script.[ext]\", { content: ... });\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\n// loaderContext.resourceQuery = \"?foo=bar\"\nloaderUtils.interpolateName(loaderContext, \"js/[hash].script.[ext][query]\", { content: ... });\n// => js/9473fdd0d880a43c21b7778d34872157.script.js?foo=bar\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\nloaderUtils.interpolateName(loaderContext, \"js/[contenthash].script.[ext]\", { content: ... });\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/page.html\"\nloaderUtils.interpolateName(loaderContext, \"html-[hash:6].html\", { content: ... });\n// => html-9473fd.html\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/flash.txt\"\nloaderUtils.interpolateName(loaderContext, \"[hash]\", { content: ... });\n// => c31e9820c001c9c4a86bce33ce43b679\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/img/image.png\"\nloaderUtils.interpolateName(loaderContext, \"[sha512:hash:base64:7].[ext]\", { content: ... });\n// => 2BKDTjl.png\n// use sha512 hash instead of xxhash64 and with only 7 chars of base64\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/img/myself.png\"\n// loaderContext.query.name =\nloaderUtils.interpolateName(loaderContext, \"picture.png\");\n// => picture.png\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/dir/file.png\"\nloaderUtils.interpolateName(loaderContext, \"[path][name].[ext]?[hash]\", { content: ... });\n// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/page-home.js\"\nloaderUtils.interpolateName(loaderContext, \"script-[1].[ext]\", { regExp: \"page-(.*)\\\\.js\", content: ... });\n// => script-home.js\n\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\n// loaderContext.resourceQuery = \"?foo=bar\"\nloaderUtils.interpolateName(\n  loaderContext,\n  (resourcePath, resourceQuery) => {\n    // resourcePath - `/app/js/javascript.js`\n    // resourceQuery - `?foo=bar`\n\n    return \"js/[hash].script.[ext]\";\n  },\n  { content: ... }\n);\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\n```\n\n### `getHashDigest`\n\n```javascript\nconst digestString = loaderUtils.getHashDigest(\n  buffer,\n  hashType,\n  digestType,\n  maxLength\n);\n```\n\n- `buffer` the content that should be hashed\n- `hashType` one of `xxhash64`, `sha1`, `md4`, `md5`, `sha256`, `sha512` or any other node.js supported hash type\n- `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`\n- `maxLength` the maximum length in chars\n\n## License\n\nMIT (http://www.opensource.org/licenses/mit-license.php)\n",
    "licenseText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz",
    "hash": "4fb104b599daafd82ef3e1a41fb9265f87e1f576",
    "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==",
    "registry": "npm",
    "packageName": "loader-utils",
    "cacheIntegrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw== sha1-T7EEtZnar9gu8+GkH7kmX4fh9XY="
  },
  "registry": "npm",
  "hash": "4fb104b599daafd82ef3e1a41fb9265f87e1f576"
}