{"_id":"@bluwy/giget-core","_rev":"8-01af2790ced01fedf76964a098a1f284","name":"@bluwy/giget-core","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@bluwy/giget-core","version":"0.1.0","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.0","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"c01179d2d12f83b080a7d7be7ed690fd2a2034fe","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.0.tgz","fileCount":10,"integrity":"sha512-cN/YvB0WW3hmYjAHeFqPMX4SWJNyWOBQCXwEbUP4kFPNFGK4xcB/+JDAclNXcL1MsTsB3FRqQtv5GGeRbXkv/A==","signatures":[{"sig":"MEUCIEcFPFTHYVTA/Qd135wQr2uEnL955efk5W1NX5hKTsyEAiEAq3kqucIuNuUR6wkbWjnjidLxXazJTcGkhroq+VjXvl8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24924},"type":"module","_from":"file:bluwy-giget-core-0.1.0.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test","format":"prettier \"**/*.{js,ts,md}\" --write","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/20e5b5b4667dcd689759707577a5b891/bluwy-giget-core-0.1.0.tgz","_integrity":"sha512-cN/YvB0WW3hmYjAHeFqPMX4SWJNyWOBQCXwEbUP4kFPNFGK4xcB/+JDAclNXcL1MsTsB3FRqQtv5GGeRbXkv/A==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.7.0","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"18.20.3","dependencies":{"nanotar":"^0.1.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.3.3","typescript":"^5.6.2","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.0_1728289581630_0.5388787294371968","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@bluwy/giget-core","version":"0.1.1","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.1","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"a4f046fcbfebfbe919426ca8042a2ca3cafedb91","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.1.tgz","fileCount":10,"integrity":"sha512-0Y6ILl9wJMkALcHGBMtkNDhXVjeFLqSEutwQThYj7jEqKpZ35j+p7QpKEhci+GyY77paMFGETXy1OBU39adWqg==","signatures":[{"sig":"MEUCIQC2BHknPcklgeFYN82rPBFkjdiIi1QYsQvzbu0Y6ciK9AIgYoLcydKtzbRYYvrxuiD1zYb37YDobp3DeOGYapy1hnU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24832},"type":"module","_from":"file:bluwy-giget-core-0.1.1.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test","format":"prettier \"**/*.{js,ts,md}\" --write","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/2556b69c60a286f4134a2f0b5b12af4e/bluwy-giget-core-0.1.1.tgz","_integrity":"sha512-0Y6ILl9wJMkALcHGBMtkNDhXVjeFLqSEutwQThYj7jEqKpZ35j+p7QpKEhci+GyY77paMFGETXy1OBU39adWqg==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.7.0","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"18.20.3","dependencies":{"tar":"^6.2.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.3.3","@types/tar":"^6.1.13","typescript":"^5.6.2","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.1_1729606834978_0.5903860654643256","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@bluwy/giget-core","version":"0.1.2","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.2","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"5c1ac082355be1e302924469a41a4ddc04826473","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.2.tgz","fileCount":10,"integrity":"sha512-v9f+ueUOKkZCDKiCm0yxKtYgYNLD9zlKarNux0NSXOvNm94QEYL3RlMpGKgD2hq44pbF2qWqEmHnCvmk56kPJw==","signatures":[{"sig":"MEQCIF7St7BdPHRhec6uwThzXP1qZkZz1Yp3HtECuNbrM2rSAiBqRrpKIOxxmMtoqsnnnh0VunMc2FtYenxyxaRQt2GOgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27052},"type":"module","_from":"file:bluwy-giget-core-0.1.2.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test","format":"prettier \"**/*.{js,ts,md}\" --write","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/4c128a9ee2fbc32cc3c47fdd0687e7fc/bluwy-giget-core-0.1.2.tgz","_integrity":"sha512-v9f+ueUOKkZCDKiCm0yxKtYgYNLD9zlKarNux0NSXOvNm94QEYL3RlMpGKgD2hq44pbF2qWqEmHnCvmk56kPJw==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.7.0","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"18.20.3","dependencies":{"tar":"^6.2.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.3.3","@types/tar":"^6.1.13","typescript":"^5.6.2","@types/node":"^22.7.4"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.2_1732722994390_0.6995240703411372","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@bluwy/giget-core","version":"0.1.3","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.3","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"e0471261172dfdb072088a4ea8c9e93aa15f3ec9","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.3.tgz","fileCount":10,"integrity":"sha512-uaotVah5dR0l45KiyHjkjMLID165GtMZ53kJ7+0w9JX2f+F/h3eTT3sd0csjJUVaak1brPbqSb7e4eB2mBnRKg==","signatures":[{"sig":"MEYCIQD6xEAFSXhcmkE0Od5zYQfggpHFu4YBvawbsYMMnPDtOgIhAMjC4YEy5FL0ALZHg7pVGw/9NJ1cQC0M/6aKJ/2yOb5Y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28230},"type":"module","_from":"file:bluwy-giget-core-0.1.3.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test \"test/*.test.js\"","format":"prettier \"**/*.{js,ts,md}\" --write","test:bun":"bun test \"test/bun-windows.spec.js\"","typecheck":"tsc"},"_npmUser":{"name":"bluwy","actor":{"name":"bluwy","type":"user","email":"bjornlu.dev@gmail.com"},"email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/c63419ca9f93281101c378c24a1d0c4f/bluwy-giget-core-0.1.3.tgz","_integrity":"sha512-uaotVah5dR0l45KiyHjkjMLID165GtMZ53kJ7+0w9JX2f+F/h3eTT3sd0csjJUVaak1brPbqSb7e4eB2mBnRKg==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.9.2","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"tar":"^7.4.3"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.0","typescript":"^5.8.3","@types/node":"^22.15.33"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.3_1751359702957_0.7413956723430728","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@bluwy/giget-core","version":"0.1.4","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.4","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"3a0cee39472c80591ee18449fdca87bea5e2f6d7","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.4.tgz","fileCount":10,"integrity":"sha512-v+5s0jeowUIm4Vil7VP9n3a41ARJ3T95nlqB+6VL4/DPA3WpI/vI8227Z7FFsosJffoBbetD1u9gAczWu+Vghw==","signatures":[{"sig":"MEYCIQDr27571bKr9+4KZdKQLgX+DwuQOAMFmG794eO4uH1+rwIhAJjLEinD/M7VqqekgKEkWdXFDRbVoC0ah+4E6OyJReGU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27593},"type":"module","_from":"file:bluwy-giget-core-0.1.4.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test \"test/*.test.js\"","format":"prettier \"**/*.{js,ts,md}\" --write","test:bun":"bun test \"test/bun-windows.spec.js\"","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/f0aa48c84f98cd30548f7a3a2ba89786/bluwy-giget-core-0.1.4.tgz","_integrity":"sha512-v+5s0jeowUIm4Vil7VP9n3a41ARJ3T95nlqB+6VL4/DPA3WpI/vI8227Z7FFsosJffoBbetD1u9gAczWu+Vghw==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.9.3","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"modern-tar":"^0.3.4"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.0","typescript":"^5.8.3","@types/node":"^22.15.33"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.4_1759219156874_0.9023033067662354","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@bluwy/giget-core","version":"0.1.5","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.5","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"dde37760096f8c9957e525ddf33d0c96f6a59205","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.5.tgz","fileCount":10,"integrity":"sha512-GBW2pomQ1+gH+WSEavLhWyNHRfFgiT2WNMUnZthm7m7cL5pZ0uE6PcHTR0Sy6s7ODj2msfMzUV2bf50ZKDeJMg==","signatures":[{"sig":"MEUCIAYp5TdcWAPwzwfbGzoii9y8fsHaoxKqo1j71p0qN2EaAiEA7gHp07/XsxT6j6FYdSwjjAS62eowvSqe2VH2oXtc1L0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28234},"type":"module","_from":"file:bluwy-giget-core-0.1.5.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test \"test/*.test.js\"","format":"prettier \"**/*.{js,ts,md}\" --write","test:bun":"bun test \"test/bun-windows.spec.js\"","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/efd5812e6ff232773cb8ca23f41e2ea7/bluwy-giget-core-0.1.5.tgz","_integrity":"sha512-GBW2pomQ1+gH+WSEavLhWyNHRfFgiT2WNMUnZthm7m7cL5pZ0uE6PcHTR0Sy6s7ODj2msfMzUV2bf50ZKDeJMg==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.9.3","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"tar":"^7.4.3"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.0","typescript":"^5.8.3","@types/node":"^22.15.33"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.5_1759332311865_0.8349886097572103","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@bluwy/giget-core","version":"0.1.6","keywords":["scaffolding","template","git","download"],"license":"MIT","_id":"@bluwy/giget-core@0.1.6","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/giget-core#readme","bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"dist":{"shasum":"fb19c9c2be7309639fb6247f79593cac0191256a","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.6.tgz","fileCount":10,"integrity":"sha512-5BwSIzqhpzXKUnSSheB0M+Qb4iGskepb35FiPA1/7AciPArTqt9H5yc53NmV21gNkDFrgbDBuzSWwrlo2aAKxg==","signatures":[{"sig":"MEUCIDJxLygLv4tH9nmrg0ylTCHfvlICYdpyGZSznqOIylE5AiEAhMolBUkqemqEXPdvPt/0M3Ri37StzP/I+1qPTAp4pl4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27593},"type":"module","_from":"file:bluwy-giget-core-0.1.6.tgz","types":"./src/index.d.ts","engines":{"node":">=18"},"exports":"./src/index.js","scripts":{"lint":"prettier \"**/*.{js,ts,md}\" --check","test":"node --test \"test/*.test.js\"","format":"prettier \"**/*.{js,ts,md}\" --write","test:bun":"bun test \"test/bun-windows.spec.js\"","typecheck":"tsc"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/ef91e14ba1bf3c37ccd0e6f4174aa16b/bluwy-giget-core-0.1.6.tgz","_integrity":"sha512-5BwSIzqhpzXKUnSSheB0M+Qb4iGskepb35FiPA1/7AciPArTqt9H5yc53NmV21gNkDFrgbDBuzSWwrlo2aAKxg==","repository":{"url":"git+https://github.com/bluwy/giget-core.git","type":"git"},"_npmVersion":"10.9.3","description":"Download template from a git repo or tarball URL","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"modern-tar":"^0.3.5"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.0","typescript":"^5.8.3","@types/node":"^22.15.33"},"_npmOperationalInternal":{"tmp":"tmp/giget-core_0.1.6_1759415607261_0.11230065351164731","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@bluwy/giget-core","description":"Download template from a git repo or tarball URL","version":"0.1.7","license":"MIT","type":"module","types":"./src/index.d.ts","exports":"./src/index.js","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/bluwy/giget-core.git"},"bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"keywords":["scaffolding","template","git","download"],"engines":{"node":">=18"},"dependencies":{"modern-tar":"^0.7.5"},"devDependencies":{"@types/node":"^25.5.0","prettier":"^3.8.1","typescript":"^5.9.3"},"scripts":{"test":"node --test \"test/*.test.js\"","test:bun":"bun test \"test/bun-windows.spec.js\"","lint":"prettier \"**/*.{js,ts,md}\" --check","format":"prettier \"**/*.{js,ts,md}\" --write","typecheck":"tsc"},"_id":"@bluwy/giget-core@0.1.7","homepage":"https://github.com/bluwy/giget-core#readme","_integrity":"sha512-6XG8TZt8DVYLuGDVSpFJaSMlNowOg5RGecvWbKvlgMoqVbztUAQ3AcWq6oZ5DoCnTzNAPcO7rhkwt8ZVgrS7CQ==","_resolved":"/private/var/folders/4m/9tvmd5f97k7b_sk_3j540blr0000gn/T/eb551647356189b70887a3919ac6bddb/bluwy-giget-core-0.1.7.tgz","_from":"file:bluwy-giget-core-0.1.7.tgz","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-6XG8TZt8DVYLuGDVSpFJaSMlNowOg5RGecvWbKvlgMoqVbztUAQ3AcWq6oZ5DoCnTzNAPcO7rhkwt8ZVgrS7CQ==","shasum":"2afba729fdb787314762dd3846b8742bbc9cb9c5","tarball":"https://registry.npmjs.org/@bluwy/giget-core/-/giget-core-0.1.7.tgz","fileCount":10,"unpackedSize":27691,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBHJMx7pu0bDFNznlF5Kb8ePyiXIyCdQsZT2Gek+jZ6OAiEAv02vk3ROBiTegBWzZ2eNsu2x0vXX+exfujIDkTl+Nrw="}]},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"directories":{},"maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/giget-core_0.1.7_1773802643232_0.5923595129727695"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-07T08:26:21.560Z","modified":"2026-03-18T02:57:23.488Z","0.1.0":"2024-10-07T08:26:21.836Z","0.1.1":"2024-10-22T14:20:35.148Z","0.1.2":"2024-11-27T15:56:34.642Z","0.1.3":"2025-07-01T08:48:23.114Z","0.1.4":"2025-09-30T07:59:17.079Z","0.1.5":"2025-10-01T15:25:12.078Z","0.1.6":"2025-10-02T14:33:27.445Z","0.1.7":"2026-03-18T02:57:23.376Z"},"bugs":{"url":"https://github.com/bluwy/giget-core/issues"},"license":"MIT","homepage":"https://github.com/bluwy/giget-core#readme","keywords":["scaffolding","template","git","download"],"repository":{"type":"git","url":"git+https://github.com/bluwy/giget-core.git"},"description":"Download template from a git repo or tarball URL","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"readme":"# @bluwy/giget-core\n\nA JavaScript API to download a template from a git repository or URL. The code is largely based on [giget](https://github.com/unjs/giget) (and includes its license), but with the following differences:\n\n- Only the JavaScript API. The CLI and unrelated APIs are stripped off.\n- Reduced dependencies to only 1 ([modern-tar](https://github.com/ayuhito/modern-tar)).\n- Reduced input and output API surface.\n- Removed custom registries and JSON template support.\n- Removed `GIGET_` special environment variables support.\n- Removed automatic fetch proxy support.\n- Supports fetching the default branch of a repository.\n- Additional API utilities.\n- Node >=18 and ESM only.\n\nSee [Migrate from giget](#migrate-from-giget) for how to migrate to `@bluwy/giget-core`.\n\n## Usage\n\nThe API is heavily documented in [./src/index.d.ts](./src/index.d.ts). Below shows some examples of using them:\n\n### `downloadTemplate`\n\nDownload a template with a given input string.\n\n```js\nimport { downloadTemplate } from '@bluwy/giget-core'\n\n// Basic usage. Download from github repo.\nconst result = await downloadTemplate('unjs/template')\n// info: { ... } - The template information parsed by providers\n// dir: '...' - The directory where the template is downloaded to\n// source: '...' - The source URL of the template (Prefix like `gh:` is stripped)\n\n// Other input syntaxes\nawait downloadTemplate('unjs/template/subdir')\nawait downloadTemplate('unjs/template#main')\nawait downloadTemplate('gh:unjs/template')\nawait downloadTemplate('gitlab:unjs/template')\nawait downloadTemplate('bitbucket:unjs/template')\nawait downloadTemplate(\n  'https://api.github.com/repos/unjs/template/tarball/main',\n)\n\n// Download to a specific directory (relative to cwd)\nawait downloadTemplate('unjs/template', { dir: 'my-project' })\n\n// Download to a directory even if it has existing content\n// (merges directories and replaces matching files)\nawait downloadTemplate('unjs/template', { force: true })\n\n// Clean directory before downloading to it\nawait downloadTemplate('unjs/template', { force: 'clean' })\n\n// Use offline cache only\nawait downloadTemplate('unjs/template', { offline: true })\n\n// Use offline cache if available, otherwise download\nawait downloadTemplate('unjs/template', { offline: 'prefer' })\n\n// Specify provider explicitly (if input has a provider prefix, it'll\n// take precedence instead)\nawait downloadTemplate('unjs/template', { provider: 'gitlab' })\n\n// Pass authentication token to access private repositories\n// (handled by providers to pass as headers when downloading the tarball)\nawait downloadTemplate('unjs/template', { providerOptions: { auth: 'xxx' } })\n```\n\n### `verifyTemplate`\n\nCheck whether the template is valid. Requires network access.\n\n```js\nimport { verifyTemplate } from '@bluwy/giget-core'\n\nawait verifyTemplate('unjs/template') // true\nawait verifyTemplate('unjs/template/subdir') // true\nawait verifyTemplate('unjs/template#main') // true\nawait verifyTemplate('gh:unjs/template') // true\nawait verifyTemplate('gitlab:unjs/template') // true\nawait verifyTemplate('bitbucket:unjs/template') // true\nawait verifyTemplate('https://api.github.com/repos/unjs/template/tarball/main') // true\n\nawait verifyTemplate('unjs/non-existent-repo') // false\nawait verifyTemplate('unjs/template/not-existent-subdir') // false\nawait verifyTemplate('unjs/template#not-existent-branch') // false\n```\n\n### `parseGitURI`\n\nParse an input (e.g. `'owner/repo/templates/foo#main'`) into a `GitInfo` object. Useful for custom providers that need to parse the given input.\n\n```js\nimport { parseGitURI } from '@bluwy/giget-core'\n\nparseGitURI('owner/repo') // { repo: 'owner/repo', subdir: '/' }\nparseGitURI('owner/repo/subdir') // { repo: 'owner/repo', subdir: '/subdir' }\nparseGitURI('owner/repo#main') // { repo: 'owner/repo', subdir: '/', ref: 'main' }\nparseGitURI('owner/repo/subdir#main') // { repo: 'owner/repo', subdir: '/subdir', ref: 'main' }\n```\n\n## Migrate from giget\n\n`giget` exports a `downloadTemplate` programmatic API as well. If you have set any options, you may need to adjust them as below:\n\n- The `forceClean` option is merged as `force: 'clean'`.\n- The `preferOffline` option is merged as `offline: 'prefer'`.\n- The `registry` option is removed. You can no longer download templates hosted from the [giget repo](https://github.com/unjs/giget/tree/main/templates). Pass the direct tarball URL or git repo instead.\n- The `install` and `silent` options used for installing dependencies is removed. You should manually install the dependencies yourself. `giget` uses [nypm](https://github.com/unjs/nypm) under the hood.\n- The `auth` option is moved to `providerOptions.auth`.\n- The `TemplateProvider` and `TemplateInfo` interfaces used by the `providers` option is slightly changed.\n  - `TemplateProvider`: The function must return a `TemplateInfo` instead of null. If it fails to handle something, it should try a helpful error.\n  - `TemplateInfo`: It no longer allows returning arbitrary keys in the object.\n- The returned object has the `TemplateInfo` on the `info` property instead of spreading on the returned object.\n- `GIGET_` environment variables support is removed. They should be passed as explicit options instead.\n- Automatic fetch proxy support is removed. To re-enable, use Node.js [v22.21.0](https://nodejs.org/en/blog/release/v22.21.0) and above, and set `NODE_USE_ENV_PROXY=1` in your environment variables. See the [Node.js docs](https://nodejs.org/api/http.html#built-in-proxy-support) for more information.\n\n## Attribution\n\nAs mentioned above, this project is based heavily on [giget](https://github.com/unjs/giget)! Thanks [@pi0](https://github.com/pi0) for the original work and battle-testing it.\n\nIn the future, I hope the code here can be merged back to `giget`, perhaps as a `giget-core` library, and have the `giget` CLI as a wrapper library.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}