{"library":"loader-utils","title":"loader-utils","description":"Utility library for webpack loaders providing functions like urlToRequest, interpolateName, getHashDigest, and isUrlRequest. Version 3.3.1 is current stable, with ongoing maintenance from webpack. Key differentiators: it's the official utility set for webpack loader authors, handling URL resolution, filename templating with hashing (supports xxhash64, sha1, sha256, sha512, md4, md5), and multiple digest formats including hex, base26, base32, base36, base49, base52, base58, base62, base64, and base64safe. Compared to similar utilities, it integrates directly with webpack's loader context.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install loader-utils"],"cli":null},"imports":["import { interpolateName } from 'loader-utils'","import { urlToRequest } from 'loader-utils'","import { getHashDigest } from 'loader-utils'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { interpolateName, urlToRequest, isUrlRequest } from 'loader-utils';\n\nfunction myLoader(loaderContext, content) {\n  if (isUrlRequest(content)) {\n    const request = urlToRequest(content, '~');\n    // ...\n  }\n  const name = interpolateName(loaderContext, '[name].[contenthash:hex:8].[ext]', { content: Buffer.from(content) });\n  return name;\n}","lang":"javascript","description":"Demonstrates importing and using urlToRequest, isUrlRequest, and interpolateName in a webpack loader.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}