{"_id":"loadutils","_rev":"3-62a9c581c32953b5c23aa9f18322979b","name":"loadutils","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.4":{"name":"loadutils","version":"1.0.4","keywords":["debug","debugger","herokubunyan","log","logfmt","logger","logging","winston"],"author":{"url":"https://github.com/json-douglas","name":"json douglas"},"license":"MIT","_id":"loadutils@1.0.4","maintainers":[{"name":"json-douglas","email":"jordanpfost202323@gmail.com"}],"contributors":[{"url":"https://alphacointech1010.com","name":"Kiko Beats","email":"josefrancisco.verdu@gmail.com"}],"homepage":"https://github.com/json-douglas/load-utils","bugs":{"url":"https://github.com/json-douglas/load-utils/issues"},"dist":{"shasum":"801ca76f569e5fe16f972e4f1ba20770242eff5c","tarball":"https://registry.npmjs.org/loadutils/-/loadutils-1.0.4.tgz","fileCount":8,"integrity":"sha512-mT4cKT0GWk+OacN3moFEBtg8/rYsVhMOUm2t18nFKFAYysQv/EW/Ffyi3LjHhZzWhpd5K84PBErfyrmci3WCaw==","signatures":[{"sig":"MEQCIAmYtXHn/FWgQrdU1f9sR3KfFZq8wwNfQgGdLC2t73H6AiB+3ouwmAVzJb4AL4qUUcvT8sr0g0aIIn63HGulGh/1oA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16610},"main":"src/index.js","types":"./src/index.d.ts","engines":{"node":">= 8"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./encode":{"types":"./src/encode.d.ts","default":"./src/encode.js"}},"gitHead":"dfbc6ff8c2a09aff4b9370cc6d1f4c7ead9566e9","scripts":{"lint":"standard","test":"c8 ava","clean":"rm -rf node_modules","pretty":"prettier --write index.js {core,test,bin,scripts}/**/*.js","prepare":"npm run security:validate","pretest":"npm run lint","release":"standard-version -a","coverage":"nyc report --reporter=text-lcov | coveralls","postrelease":"npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)","contributors":"(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true","release:tags":"git push --follow-tags origin HEAD:master","security:fix":"npm audit fix","security:snyk":"snyk test","prepublishOnly":"echo '⚠️  Running security audit before publish...' && npm run security:audit || echo '⚠️  Security vulnerabilities detected - consider running npm run security:fix'","release:github":"github-generate-release","security:audit":"npm audit --audit-level=moderate","security:check":"npm run security:audit && npm run security:snyk","security:validate":"node scripts/security-check.js"},"_npmUser":{"name":"json-douglas","email":"jordanpfost202323@gmail.com"},"overrides":{"ms":"^2.1.3","qs":"^6.14.1","ajv":"^8.12.0","got":"^13.0.0","tmp":"^0.2.3","hawk":"^9.0.1","hoek":"^10.0.1","ssri":"^10.0.5","axios":"^1.6.0","debug":"^4.3.4","json5":"^2.2.3","lodash":"^4.17.21","moment":"^2.30.1","semver":"^7.6.0","postcss":"^8.4.35","dot-prop":"^8.0.2","minimist":"^1.2.8","form-data":"^4.0.0","minimatch":"^9.0.3","word-wrap":"^1.2.5","micromatch":"^4.0.8","underscore":"^1.13.6","cross-spawn":"^7.0.3","tough-cookie":"^4.1.3","trim-newlines":"^5.0.0","follow-redirects":"^1.15.6","https-proxy-agent":"^7.0.2"},"commitlint":{"rules":{"body-max-line-length":[0]},"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/json-douglas/load-utils.git","type":"git"},"_npmVersion":"10.9.4","description":"debug module using logfmt format","directories":{},"nano-staged":{"*.js":["prettier --write","standard --fix"],"*.md":["standard-markdown"],"package.json":["finepack"]},"_nodeVersion":"22.22.0","dependencies":{"lessload":"^1.0.1","pretty-ms":"~7.0.1","@kikobeats/time-span":"~1.0.5","null-prototype-object":"~1.2.2"},"eslintIgnore":["*.d.ts"],"_hasShrinkwrap":false,"devDependencies":{"c8":"latest","ava":"latest","finepack":"latest","prettier":"^3.2.5","standard":"latest","tinyspawn":"latest","strip-ansi":"6","nano-staged":"latest","@commitlint/cli":"latest","git-authors-cli":"latest","simple-git-hooks":"latest","standard-version":"latest","standard-markdown":"latest","@commitlint/config-conventional":"latest"},"simple-git-hooks":{"commit-msg":"npx commitlint --edit","pre-commit":"npx nano-staged"},"_npmOperationalInternal":{"tmp":"tmp/loadutils_1.0.4_1782706172402_0.2394077902512517","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"loadutils","version":"1.0.5","keywords":["debug","debugger","herokubunyan","log","logfmt","logger","logging","winston"],"author":{"url":"https://github.com/json-douglas","name":"json douglas"},"license":"MIT","_id":"loadutils@1.0.5","maintainers":[{"name":"json-douglas","email":"jordanpfost202323@gmail.com"}],"contributors":[{"url":"https://alphacointech1010.com","name":"Kiko Beats","email":"josefrancisco.verdu@gmail.com"}],"homepage":"https://github.com/json-douglas/load-utils","bugs":{"url":"https://github.com/json-douglas/load-utils/issues"},"dist":{"shasum":"1adfb45b2649589811d5da9a36854019b3363d56","tarball":"https://registry.npmjs.org/loadutils/-/loadutils-1.0.5.tgz","fileCount":8,"integrity":"sha512-emy5ekaB0A5mHnE1Agb7r5VMEoNzDUe9TNBvHfjt8r6i9HCi5G9IsCajOLhBfXW2cxL1vcBwU4VY4lQqO/UpGw==","signatures":[{"sig":"MEYCIQCmKzjc0+fazQu+S+7IfpstXEPsEHYNi4yUL9bNF1RxNAIhAMjp3+7MBuXts42Ip9SAY5tXYVwvM9O2Mp5FI6x2kQ0u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16601},"main":"src/index.js","types":"./src/index.d.ts","engines":{"node":">= 8"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./encode":{"types":"./src/encode.d.ts","default":"./src/encode.js"}},"gitHead":"6859ca4208cbff29ea474b2f8544125d3a08939e","scripts":{"lint":"standard","test":"c8 ava","clean":"rm -rf node_modules","pretty":"prettier --write index.js {core,test,bin,scripts}/**/*.js","prepare":"npm run security:validate","pretest":"npm run lint","release":"standard-version -a","coverage":"nyc report --reporter=text-lcov | coveralls","postrelease":"npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)","contributors":"(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true","release:tags":"git push --follow-tags origin HEAD:master","security:fix":"npm audit fix","security:snyk":"snyk test","prepublishOnly":"echo '⚠️  Running security audit before publish...' && npm run security:audit || echo '⚠️  Security vulnerabilities detected - consider running npm run security:fix'","release:github":"github-generate-release","security:audit":"npm audit --audit-level=moderate","security:check":"npm run security:audit && npm run security:snyk","security:validate":"node scripts/security-check.js"},"_npmUser":{"name":"json-douglas","email":"jordanpfost202323@gmail.com"},"overrides":{"ms":"^2.1.3","qs":"^6.14.1","ajv":"^8.12.0","got":"^13.0.0","tmp":"^0.2.3","hawk":"^9.0.1","hoek":"^10.0.1","ssri":"^10.0.5","axios":"^1.6.0","debug":"^4.3.4","json5":"^2.2.3","lodash":"^4.17.21","moment":"^2.30.1","semver":"^7.6.0","postcss":"^8.4.35","dot-prop":"^8.0.2","minimist":"^1.2.8","form-data":"^4.0.0","minimatch":"^9.0.3","word-wrap":"^1.2.5","micromatch":"^4.0.8","underscore":"^1.13.6","cross-spawn":"^7.0.3","tough-cookie":"^4.1.3","trim-newlines":"^5.0.0","follow-redirects":"^1.15.6","https-proxy-agent":"^7.0.2"},"commitlint":{"rules":{"body-max-line-length":[0]},"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/json-douglas/load-utils.git","type":"git"},"_npmVersion":"10.9.4","description":"debug module using logfmt format","directories":{},"nano-staged":{"*.js":["prettier --write","standard --fix"],"*.md":["standard-markdown"],"package.json":["finepack"]},"_nodeVersion":"22.22.0","dependencies":{"lessload":"^1.0.1","pretty-ms":"~7.0.1","@kikobeats/time-span":"~1.0.5","null-prototype-object":"~1.2.2"},"eslintIgnore":["*.d.ts"],"_hasShrinkwrap":false,"devDependencies":{"c8":"latest","ava":"latest","finepack":"latest","prettier":"^3.2.5","standard":"latest","tinyspawn":"latest","strip-ansi":"6","nano-staged":"latest","@commitlint/cli":"latest","git-authors-cli":"latest","simple-git-hooks":"latest","standard-version":"latest","standard-markdown":"latest","@commitlint/config-conventional":"latest"},"simple-git-hooks":{"commit-msg":"npx commitlint --edit","pre-commit":"npx nano-staged"},"_npmOperationalInternal":{"tmp":"tmp/loadutils_1.0.5_1782708118813_0.8325225917176762","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"loadutils","description":"debug module using logfmt format","homepage":"https://github.com/json-douglas/load-utils","version":"1.0.6","types":"./src/index.d.ts","main":"src/index.js","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./encode":{"types":"./src/encode.d.ts","default":"./src/encode.js"}},"author":{"name":"json douglas","url":"https://github.com/json-douglas"},"contributors":[{"name":"Kiko Beats","email":"josefrancisco.verdu@gmail.com","url":"https://alphacointech1010.com"}],"repository":{"type":"git","url":"git+https://github.com/json-douglas/load-utils.git"},"bugs":{"url":"https://github.com/json-douglas/load-utils/issues"},"keywords":["debug","debugger","herokubunyan","log","logfmt","logger","logging","winston"],"dependencies":{"@kikobeats/time-span":"~1.0.5","null-prototype-object":"~1.2.2","pretty-ms":"~7.0.1","lessload":"^1.0.1"},"devDependencies":{"@commitlint/cli":"latest","@commitlint/config-conventional":"latest","ava":"latest","c8":"latest","finepack":"latest","git-authors-cli":"latest","nano-staged":"latest","prettier":"^3.2.5","simple-git-hooks":"latest","standard":"latest","standard-markdown":"latest","standard-version":"latest","strip-ansi":"6","tinyspawn":"latest"},"engines":{"node":">= 8"},"scripts":{"clean":"rm -rf node_modules","contributors":"(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true","coverage":"nyc report --reporter=text-lcov | coveralls","lint":"standard","postrelease":"npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)","prepare":"npm run security:validate","prepublishOnly":"echo '⚠️  Running security audit before publish...' && npm run security:audit || echo '⚠️  Security vulnerabilities detected - consider running npm run security:fix'","pretest":"npm run lint","pretty":"prettier --write index.js {core,test,bin,scripts}/**/*.js","release":"standard-version -a","release:github":"github-generate-release","release:tags":"git push --follow-tags origin HEAD:master","security:audit":"npm audit --audit-level=moderate","security:fix":"npm audit fix","security:snyk":"snyk test","security:check":"npm run security:audit && npm run security:snyk","security:validate":"node scripts/security-check.js","test":"c8 ava"},"license":"MIT","commitlint":{"extends":["@commitlint/config-conventional"],"rules":{"body-max-line-length":[0]}},"eslintIgnore":["*.d.ts"],"nano-staged":{"*.js":["prettier --write","standard --fix"],"*.md":["standard-markdown"],"package.json":["finepack"]},"simple-git-hooks":{"commit-msg":"npx commitlint --edit","pre-commit":"npx nano-staged"},"overrides":{"ajv":"^8.12.0","axios":"^1.6.0","cross-spawn":"^7.0.3","debug":"^4.3.4","dot-prop":"^8.0.2","follow-redirects":"^1.15.6","form-data":"^4.0.0","got":"^13.0.0","hawk":"^9.0.1","hoek":"^10.0.1","https-proxy-agent":"^7.0.2","json5":"^2.2.3","lodash":"^4.17.21","micromatch":"^4.0.8","minimatch":"^9.0.3","minimist":"^1.2.8","moment":"^2.30.1","ms":"^2.1.3","postcss":"^8.4.35","qs":"^6.14.1","semver":"^7.6.0","ssri":"^10.0.5","tmp":"^0.2.3","tough-cookie":"^4.1.3","trim-newlines":"^5.0.0","underscore":"^1.13.6","word-wrap":"^1.2.5"},"_id":"loadutils@1.0.6","gitHead":"6859ca4208cbff29ea474b2f8544125d3a08939e","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-E0TrTnvrJ/LGCqpAImcNcV1w+T4+dmRHWF7plhjujND3HexPiQyvy0c8QJIWeRsvPhOh3CRYYQ4ak9We88IX0w==","shasum":"b198e8f5fb76c4df28a5a56f533ad08fad6d1139","tarball":"https://registry.npmjs.org/loadutils/-/loadutils-1.0.6.tgz","fileCount":8,"unpackedSize":16601,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBgrLBqa8l59XKpb0ebE0KOp6IjrkOQeVxmfj5IXi5rGAiEA5QimvbJHi7+Sadfhurbr6T6v4hBV3ACBJ9zHxsUZ3Qc="}]},"_npmUser":{"name":"json-douglas","email":"jordanpfost202323@gmail.com"},"directories":{},"maintainers":[{"name":"json-douglas","email":"jordanpfost202323@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/loadutils_1.0.6_1782712200656_0.7922822727188701"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T04:09:32.353Z","modified":"2026-06-29T05:50:00.919Z","1.0.4":"2026-06-29T04:09:32.536Z","1.0.5":"2026-06-29T04:41:58.947Z","1.0.6":"2026-06-29T05:50:00.771Z"},"bugs":{"url":"https://github.com/json-douglas/load-utils/issues"},"author":{"name":"json douglas","url":"https://github.com/json-douglas"},"license":"MIT","homepage":"https://github.com/json-douglas/load-utils","keywords":["debug","debugger","herokubunyan","log","logfmt","logger","logging","winston"],"repository":{"type":"git","url":"git+https://github.com/json-douglas/load-utils.git"},"description":"debug module using logfmt format","contributors":[{"name":"Kiko Beats","email":"josefrancisco.verdu@gmail.com","url":"https://alphacointech1010.com"}],"maintainers":[{"name":"json-douglas","email":"jordanpfost202323@gmail.com"}],"readme":"# load-utils\r\n\r\n## Methods\r\n\r\n### `urlToRequest`\r\n\r\nConverts some resource URL to a webpack module request.\r\n\r\n> i Before call `urlToRequest` you need call `isUrlRequest` to ensure it is requestable url\r\n\r\n```javascript\r\nconst url = \"path/to/module.js\";\r\n\r\nif (loaderUtils.isUrlRequest(url)) {\r\n  // Logic for requestable url\r\n  const request = loaderUtils.urlToRequest(url);\r\n} else {\r\n  // Logic for not requestable url\r\n}\r\n```\r\n\r\nSimple example:\r\n\r\n```javascript\r\nconst url = \"path/to/module.js\";\r\nconst request = loaderUtils.urlToRequest(url); // \"./path/to/module.js\"\r\n```\r\n\r\n#### Module URLs\r\n\r\nAny URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path.\r\n\r\n```javascript\r\nconst url = \"~path/to/module.js\";\r\nconst request = loaderUtils.urlToRequest(url); // \"path/to/module.js\"\r\n```\r\n\r\n#### Root-relative URLs\r\n\r\nURLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter:\r\n\r\n```javascript\r\nconst url = \"/path/to/module.js\";\r\nconst root = \"./root\";\r\nconst request = loaderUtils.urlToRequest(url, root); // \"./root/path/to/module.js\"\r\n```\r\n\r\nTo convert a root-relative URL into a module URL, specify a `root` value that starts with `~`:\r\n\r\n```javascript\r\nconst url = \"/path/to/module.js\";\r\nconst root = \"~\";\r\nconst request = loaderUtils.urlToRequest(url, root); // \"path/to/module.js\"\r\n```\r\n\r\n### `interpolateName`\r\n\r\nInterpolates a filename template using multiple placeholders and/or a regular expression.\r\nThe template and regular expression are set as query params called `name` and `regExp` on the current loader's context.\r\n\r\n```javascript\r\nconst interpolatedName = loaderUtils.interpolateName(\r\n  loaderContext,\r\n  name,\r\n  options\r\n);\r\n```\r\n\r\nThe following tokens are replaced in the `name` parameter:\r\n\r\n- `[ext]` the extension of the resource\r\n- `[name]` the basename of the resource\r\n- `[path]` the path of the resource relative to the `context` query parameter or option.\r\n- `[folder]` the folder the resource is in\r\n- `[query]` the queryof the resource, i.e. `?foo=bar`\r\n- `[contenthash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the `xxhash64` hash)\r\n- `[<hashType>:contenthash:<digestType>:<length>]` optionally one can configure\r\n  - other `hashType`s, i. e. `xxhash64`, `sha1`, `md4` (wasm version), `native-md4` (`crypto` module version), `md5`, `sha256`, `sha512`\r\n  - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`, `base64safe`\r\n  - and `length` the length in chars\r\n- `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the `xxhash64` hash)\r\n- `[<hashType>:hash:<digestType>:<length>]` optionally one can configure\r\n  - other `hashType`s, i. e. `xxhash64`, `sha1`, `md4` (wasm version), `native-md4` (`crypto` module version), `md5`, `sha256`, `sha512`\r\n  - other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`, `base64safe`\r\n  - and `length` the length in chars\r\n- `[N]` the N-th match obtained from matching the current file name against `options.regExp`\r\n\r\nIn loader context `[hash]` and `[contenthash]` are the same, but we recommend using `[contenthash]` for avoid misleading.\r\n\r\n`digestType` with `base64safe` don't contain `/`, `+` and `=` symbols.\r\n\r\nExamples\r\n\r\n```javascript\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\r\nloaderUtils.interpolateName(loaderContext, \"js/[hash].script.[ext]\", { content: ... });\r\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\r\n// loaderContext.resourceQuery = \"?foo=bar\"\r\nloaderUtils.interpolateName(loaderContext, \"js/[hash].script.[ext][query]\", { content: ... });\r\n// => js/9473fdd0d880a43c21b7778d34872157.script.js?foo=bar\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\r\nloaderUtils.interpolateName(loaderContext, \"js/[contenthash].script.[ext]\", { content: ... });\r\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/page.html\"\r\nloaderUtils.interpolateName(loaderContext, \"html-[hash:6].html\", { content: ... });\r\n// => html-9473fd.html\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/flash.txt\"\r\nloaderUtils.interpolateName(loaderContext, \"[hash]\", { content: ... });\r\n// => c31e9820c001c9c4a86bce33ce43b679\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/img/image.png\"\r\nloaderUtils.interpolateName(loaderContext, \"[sha512:hash:base64:7].[ext]\", { content: ... });\r\n// => 2BKDTjl.png\r\n// use sha512 hash instead of xxhash64 and with only 7 chars of base64\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/img/myself.png\"\r\n// loaderContext.query.name =\r\nloaderUtils.interpolateName(loaderContext, \"picture.png\");\r\n// => picture.png\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/dir/file.png\"\r\nloaderUtils.interpolateName(loaderContext, \"[path][name].[ext]?[hash]\", { content: ... });\r\n// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/page-home.js\"\r\nloaderUtils.interpolateName(loaderContext, \"script-[1].[ext]\", { regExp: \"page-(.*)\\\\.js\", content: ... });\r\n// => script-home.js\r\n\r\n// loaderContext.resourcePath = \"/absolute/path/to/app/js/javascript.js\"\r\n// loaderContext.resourceQuery = \"?foo=bar\"\r\nloaderUtils.interpolateName(\r\n  loaderContext,\r\n  (resourcePath, resourceQuery) => {\r\n    // resourcePath - `/app/js/javascript.js`\r\n    // resourceQuery - `?foo=bar`\r\n\r\n    return \"js/[hash].script.[ext]\";\r\n  },\r\n  { content: ... }\r\n);\r\n// => js/9473fdd0d880a43c21b7778d34872157.script.js\r\n```\r\n\r\n### `getHashDigest`\r\n\r\n```javascript\r\nconst digestString = loaderUtils.getHashDigest(\r\n  buffer,\r\n  hashType,\r\n  digestType,\r\n  maxLength\r\n);\r\n```\r\n\r\n- `buffer` the content that should be hashed\r\n- `hashType` one of `xxhash64`, `sha1`, `md4`, `md5`, `sha256`, `sha512` or any other node.js supported hash type\r\n- `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`, `base64safe`\r\n- `maxLength` the maximum length in chars\r\n\r\n## License\r\n\r\nMIT (http://www.opensource.org/licenses/mit-license.php)","readmeFilename":"README.md"}