1 | {"version":3,"file":"get-raw-package-manifest.esm.js","sources":["../../src/endpoints/get-raw-package-manifest.ts"],"sourcesContent":["import { RawPackageManifest } from '../types/raw-package-manifest';\nimport { extractRawPackageManifest } from '../utils/extract-package-manifest';\nimport { getRawPackument } from './get-raw-packument';\n\n/**\n * `getRawPackageManifest` returns the manifest describing\n * a specific version of a package.\n *\n * Note: the manifest is returned as retrieved from the registry.\n *\n * @param name - package name\n * @param version - package version (default: `latest`)\n * @param registry - URL of the registry (default: npm registry)\n * @param mirrors - URLs of the registry mirrors (default: npm registry mirrors)\n * @param cached - accept cached responses (default: `true`)\n *\n * @example\n * Get the latest manifest for package `query-registry` from the npm registry:\n *\n * ```typescript\n * import { getRawPackageManifest } from 'query-registry';\n *\n * (async () => {\n * const manifest = await getRawPackageManifest({ name: 'query-registry' });\n *\n * // Output: 'query-registry'\n * console.log(manifest.name);\n * })();\n * ```\n *\n * @example\n * Get the manifest for package `query-registry@1.0.0` from the npm registry:\n *\n * ```typescript\n * import { getRawPackageManifest } from 'query-registry';\n *\n * (async () => {\n * const manifest = await getRawPackageManifest({ name: 'query-registry', version: '1.0.0' });\n *\n * // Output: 'query-registry'\n * console.log(manifest.name);\n *\n * // Output: '1.0.0'\n * console.log(manifest.version);\n * })();\n * ```\n *\n * @see {@link RawPackageManifest}\n * @see {@link npmRegistry}\n * @see {@link npmRegistryMirrors}\n */\nexport async function getRawPackageManifest({\n name,\n version,\n registry,\n mirrors,\n cached,\n}: {\n name: string;\n version?: string;\n registry?: string;\n mirrors?: string[];\n cached?: boolean;\n}): Promise<RawPackageManifest> {\n const rawPackument = await getRawPackument({\n name,\n registry,\n mirrors,\n cached,\n });\n\n return extractRawPackageManifest({ rawPackument, version });\n}\n"],"names":["getRawPackageManifest","name","version","registry","mirrors","cached","rawPackument","getRawPackument","extractRawPackageManifest"],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CO,eAAeA,qBAAf,CAAqC;AACxCC,EAAAA,IADwC;AAExCC,EAAAA,OAFwC;AAGxCC,EAAAA,QAHwC;AAIxCC,EAAAA,OAJwC;AAKxCC,EAAAA;AALwC,CAArC;AAaH,QAAMC,YAAY,GAAG,MAAMC,eAAe,CAAC;AACvCN,IAAAA,IADuC;AAEvCE,IAAAA,QAFuC;AAGvCC,IAAAA,OAHuC;AAIvCC,IAAAA;AAJuC,GAAD,CAA1C;AAOA,SAAOG,yBAAyB,CAAC;AAAEF,IAAAA,YAAF;AAAgBJ,IAAAA;AAAhB,GAAD,CAAhC;AACH;;;;"} |