{"_id":"@adaptive-ds/generate-image-list","_rev":"2-607b66ecbfddbfe2d8a53b0110184671","name":"@adaptive-ds/generate-image-list","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@adaptive-ds/generate-image-list","version":"0.1.0","keywords":["image","images","dimensions","width","height","typescript","generator","assets"],"license":"MIT","_id":"@adaptive-ds/generate-image-list@0.1.0","maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"homepage":"https://github.com/david1gp/generate-image-list#readme","bugs":{"url":"https://github.com/david1gp/generate-image-list/issues"},"dist":{"shasum":"c692f4dc56f472b0e374ffbb151388ad87feba4d","tarball":"https://registry.npmjs.org/@adaptive-ds/generate-image-list/-/generate-image-list-0.1.0.tgz","fileCount":10,"integrity":"sha512-znVQmAk3j047RbFmO2VqluU8x90SdHWjBdOwq/fh+kUqN/0dx1r8zNWY6+D2t07tmNGWpuEQPofnePQ1G6QP0g==","signatures":[{"sig":"MEQCIGqN40/BknSagH8roh7xPGSgCp1wqqxCq724W2zX1WrlAiBPxjEEyQLInrN0AZJoPxLtV/+P8AtajV9BMy216wipIw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12373},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"73eb43961b37ef9adca4ba3889167f5352c46a04","private":false,"scripts":{"build":"bun build.ts","format":"bunx prettier --write src/ build.ts"},"_npmUser":{"name":"david1gp","email":"david1gruppenplan@gmail.com"},"prettier":{"semi":false,"printWidth":120,"trailingComma":"all"},"repository":{"url":"git+https://github.com/david1gp/generate-image-list.git"},"_npmVersion":"10.9.4","description":"Auto-generate TypeScript image lists with dimensions. No manual measurement required.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"image-size":"^2.0.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.9.3","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/generate-image-list_0.1.0_1773411247723_0.23965918594045021","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@adaptive-ds/generate-image-list","version":"0.2.0","scripts":{"build":"bun build.ts","format":"bunx prettier --write src/ build.ts","release":"bash ops/release.sh"},"dependencies":{"image-size":"^2.0.2"},"devDependencies":{"@types/bun":"latest","@types/node":"^25.5.0","typescript":"^5.9.3"},"prettier":{"semi":false,"printWidth":120,"trailingComma":"all"},"type":"module","private":false,"license":"MIT","description":"Auto-generate TypeScript image lists with dimensions. No manual measurement required.","keywords":["image","images","dimensions","width","height","typescript","generator","assets"],"repository":{"url":"git+https://github.com/david1gp/generate-image-list.git"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"gitHead":"75d12ba81fedbb22bdcb852c18e49f0e212ec17a","_id":"@adaptive-ds/generate-image-list@0.2.0","bugs":{"url":"https://github.com/david1gp/generate-image-list/issues"},"homepage":"https://github.com/david1gp/generate-image-list#readme","_nodeVersion":"20.20.0","_npmVersion":"11.11.1","dist":{"integrity":"sha512-KfJzw8hJcNq6/BuZ/V5Z+Wk+DOq15/cA92bQtvOLpCnZ6D1KkLu+qcG/CLx731H1ClZ/monJvGT9RPW11CrPDQ==","shasum":"5378f0030cfcf01e103441a5dd9132ea73210472","tarball":"https://registry.npmjs.org/@adaptive-ds/generate-image-list/-/generate-image-list-0.2.0.tgz","fileCount":10,"unpackedSize":12131,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaptive-ds%2fgenerate-image-list@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDnfLzTHC/N71tY/yQeWQ21Y7RWqGWaX3Dp511SCMyspQIgVQH+f7pQVYgYnc0af2TVRO4lFyVV0GBPgdGrEWK0hZ4="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3e0ff334-b823-4a63-a75a-75bbecd15446"}},"directories":{},"maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/generate-image-list_0.2.0_1773437376647_0.6082803715212144"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-13T14:14:07.654Z","modified":"2026-03-13T21:29:37.053Z","0.1.0":"2026-03-13T14:14:07.861Z","0.2.0":"2026-03-13T21:29:36.790Z"},"bugs":{"url":"https://github.com/david1gp/generate-image-list/issues"},"license":"MIT","homepage":"https://github.com/david1gp/generate-image-list#readme","keywords":["image","images","dimensions","width","height","typescript","generator","assets"],"repository":{"url":"git+https://github.com/david1gp/generate-image-list.git"},"description":"Auto-generate TypeScript image lists with dimensions. No manual measurement required.","maintainers":[{"name":"david1gp","email":"david1gruppenplan@gmail.com"}],"readme":"# @adaptive-ds/generate-image-list\n\n> Stop manually typing image dimensions. Let your build do it for you.\n\nEver added a new image to your project, then had to manually open it in an image editor just to copy-paste its dimensions into your code? Yeah, we hated that too.\n\nThis tool automatically scans a directory of images and generates a typed TypeScript file with all the metadata you need.\n\n## Features\n\n- **Auto-detect dimensions** — Extracts width and height from any image\n- **Type-safe output** — Generates TypeScript with full type inference\n- **Preserves alt text** — Keeps existing alt text when regenerating\n- **Sorted output** — Deterministic, sorted keys for clean diffs\n- **Multi-format support** — jpg, png, gif, webp, avif, tiff, svg\n\n## Installation\n\n```bash\nbun add @adaptive-ds/generate-image-list\n```\n\n## Usage\n\n```typescript\nimport { generateImageList } from \"@adaptive-ds/generate-image-list\"\n\nawait generateImageList(\n  \"./images\",           // directory to scan\n  existingImages,       // existing image map (to preserve alt text)\n  \"./generated.ts\",    // output file path\n  \"@/types\"            // path to import ImageType from\n)\n```\n\nThis generates a file like:\n\n```typescript\nimport type { ImageType from \"@/types\" }\n// Auto-generated, manual changes will be lost\nexport const imageList = {\n  hero_banner: {\n    path: \"hero-banner.png\",\n    width: 1920,\n    height: 1080,\n    alt: \"hero banner\",\n    mimeType: \"image/png\",\n  },\n  logo: {\n    path: \"logo.svg\",\n    width: 200,\n    height: 50,\n    alt: \"logo\",\n    mimeType: \"image/svg+xml\",\n  },\n} as const satisfies Record<string, ImageType>\n```\n\n## API\n\n### `generateImageList(imageDirectory, existingImages, outputPath, imageTypeImportPath)`\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `imageDirectory` | `string` | Path to scan for images |\n| `existingImages` | `Record<string, ImageType>` | Existing map to preserve alt text |\n| `outputPath` | `string` | Where to write the generated file |\n| `imageTypeImportPath` | `string` | Import path for the `ImageType` type |\n\n### `ImageType`\n\n```typescript\ninterface ImageType {\n  path: string\n  width: number\n  height: number\n  alt: string\n  mimeType?: string\n}\n```\n\n## Use with your existing images\n\nIf you already have an image list, pass it as the second argument to preserve alt text:\n\n```typescript\nimport { generateImageList } from \"@adaptive-ds/generate-image-list\"\nimport { imageList as existingImages } from \"./generated\"\n\nawait generateImageList(\n  \"./images\",\n  existingImages,\n  \"./generated.ts\",\n  \"@/types\"\n)\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}