{"id":15287820,"url":"https://github.com/billykwok/reshoot","last_synced_at":"2025-10-07T02:31:45.691Z","repository":{"id":38271774,"uuid":"162604302","full_name":"billykwok/reshoot","owner":"billykwok","description":"📸 All-in-one JavaScript / Typescript image framework that makes the processing and rendering of responsive images as easy and efficient as possible.","archived":true,"fork":false,"pushed_at":"2022-08-25T19:23:37.000Z","size":15547,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-01T15:38:04.593Z","etag":null,"topics":["babel-macros","images","javascript","lqip","react","reactjs","srcset","typescript","webpack-loader","website"],"latest_commit_sha":null,"homepage":"https://github.com/billykwok/reshoot","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billykwok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"billykwok","tidelift":"npm/reshoot"}},"created_at":"2018-12-20T16:25:20.000Z","updated_at":"2023-08-13T14:26:08.000Z","dependencies_parsed_at":"2022-08-09T02:16:45.876Z","dependency_job_id":null,"html_url":"https://github.com/billykwok/reshoot","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billykwok%2Freshoot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billykwok%2Freshoot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billykwok%2Freshoot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billykwok%2Freshoot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billykwok","download_url":"https://codeload.github.com/billykwok/reshoot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235581533,"owners_count":19013089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel-macros","images","javascript","lqip","react","reactjs","srcset","typescript","webpack-loader","website"],"created_at":"2024-09-30T15:38:05.895Z","updated_at":"2025-10-07T02:31:40.357Z","avatar_url":"https://github.com/billykwok.png","language":"TypeScript","funding_links":["https://github.com/sponsors/billykwok","https://tidelift.com/funding/github/npm/reshoot"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/billykwok/reshoot/main/logo.png\" width=\"200\" alt=\"Reshoot logo\" /\u003e\n\nReshoot is a JavaScript / Typescript image framework that makes the processing and rendering of responsive images as easy and efficient as possible.\n\n## What is in the box\n\nReshoot currently consists of the following packages.\n\n### User packages\n\nPackages you will likely use directly, as they interface with the libraries and tools in your projects.\n\n| Package                                                                                | Description                                                                                                                                                                                                                                                                                                         |\n| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`@reshoot/react`](https://www.npmjs.com/package/@reshoot/react)                       | A [`React`](https://reactjs.org) component rendering responsive images, designed to accept the output meta data of [`@reshoot/loader`](https://www.npmjs.com/package/@reshoot/loader).                                                                                                                              |\n| [`@reshoot/loader`](https://www.npmjs.com/package/@reshoot/loader)                     | A Webpack [`loader`](https://webpack.js.org/loaders) that returns low-quality image placeholder ([`lqip`](https://github.com/zouhir/lqip)) and meta data of the images.                                                                                                                                             |\n| [`@reshoot/macro`](https://www.npmjs.com/package/@reshoot/macro)                       | A [`babel-macro`](https://github.com/kentcdodds/babel-plugin-macros) transpiling `reshoot('image.png', { color: '#eee' })` into `import meta from 'image.png?color=#eee';`.                                                                                                                                         |\n| [`@reshoot/remark-mdx-image`](https://www.npmjs.com/package/@reshoot/remark-mdx-image) | An [`mdx`](https://mdxjs.com) / [`remark-plugin`](https://github.com/remarkjs/remark) transpiling `![alt text](image.png \"title\"){{color='#eee'}}` into the following.\u003cpre lang=\"mdx\"\u003eimport meta from 'image.png?color=#eee';\u003cbr/\u003e\u0026lt;img meta={meta} alt=\u0026quot;alt text\u0026quot; title=\u0026quot;title\u0026quot; /\u0026gt;\u003c/pre\u003e |\n\n\u003e These packages can be used selectively to fit your specific use cases. For example, you can ignore `@reshoot/remark-mdx-image` if you are not using `mdx`. Or you can use `@reshoot/loader` to generate responsive images, but build your own `\u003cImg /\u003e` component to render the images. Or you can just use `@reshoot/react` for images that you prepared yourself.\n\u003e\n\u003e Currently Reshoot assumes that you use Webpack, Babel and React. Support for other frameworks/libraries will be considered in the future.\n\n### Core packages\n\nPackages that you will rarely need to use, as they are the underlying logics and infrastructural components of Reshoot.\n\n| Package                                                          | Description                                                                                                 |\n| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |\n| [`@reshoot/core`](https://www.npmjs.com/package/@reshoot/core)   | A backend library for extracting meta data and generating low-quality iamge placeholder from a given image. |\n| [`@reshoot/types`](https://www.npmjs.com/package/@reshoot/types) | Enums and types shared across the above libraries.                                                          |\n\n## Documentation via Example Usage\n\nHere is a simple demonstration on how to use all four Reshoot user packages.\n\n### Installation\n\n```sh\n# PNPM\npnpm add @reshoot/react\npnpm add -D @reshoot/loader @reshoot/macro @reshoot/remark-mdx-image\n\n# NPM\nnpm install @reshoot/react\nnpm install -D @reshoot/loader @reshoot/macro @reshoot/remark-mdx-image\n\n# yarn\nyarn add @reshoot/react\nyarn add -D @reshoot/loader @reshoot/macro @reshoot/remark-mdx-image\n```\n\n### Setup\n\n```js\n// babel.config.js\nmodule.exports = {\n  // ...\n  plugins: ['babel-plugin-macros'],\n};\n```\n\n```js\n// webpack.config.js\nimport reshootRemarkMdxImage from '@reshoot/remark-mdx-image';\n\nexport default {\n  // ...\n  module: {\n    rules: [\n      {\n        test: /\\.(jpe?g|png|webp|gif|svg)$/i,\n        use: [\n          {\n            loader: '@reshoot/loader',\n            options: {\n              meta: {\n                // The color of placeholder image while loading. It is the dominant color of the image if this option is set to null\n                // Type: '#abc' | '#abcdef' | 'transparent' | null\n                color: null,\n                // The size of placeholder image\n                // Type: number\n                placeholderSize: 8,\n                // The quality of placeholder image\n                // Type: number (1 - 10)\n                placeholderQuality: 10,\n                // The type of the aspect ratio in the output meta data\n                // Type: 'heightByWidth' | 'widthByHeight'\n                aspectRatioType: 'heightByWidth',\n                // The format of the aspect ratio in the output meta data\n                // Type: 'percent' | 'ratio'\n                aspectRatioFormat: 'precent',\n                // The number of decimals of the aspect ratio in the output meta data\n                // Type: number\n                aspectRatioDecimal: 4,\n              },\n              // The shape of the output meta data\n              // Type: (output: object, resourcePath: string) =\u003e Field\n              shape: ({\n                hash,\n                src,\n                width,\n                height,\n                aspectRatio,\n                placeholder,\n                color,\n              }) =\u003e ({\n                hash,\n                src,\n                width,\n                height,\n                aspectRatio,\n                placeholder,\n                color,\n              }),\n              // File name pattern of the output image\n              // Type: string\n              filename: '[contenthash:16].[ext]', // default to '[path][name].[ext]' in development mode\n              // Output path of the output images\n              // Type: string | ((path: string) =\u003e string)| null\n              outputPath: null,\n              // Public path\n              // Type: string | ((filename: string) =\u003e string)\n              publicPath: '/',\n              // Whether to emit the image the file system (useful for static site generation using both client-side and server-side builds)\n              // Type: boolean\n              emitFile: true,\n              // Whether to export meta data in the ES module syntax\n              // Type: boolean\n              esModule: false,\n            },\n          },\n        ],\n      },\n      {\n        test: /\\.mdx$/i,\n        use: [\n          {\n            loader: '@mdx-js/loader',\n            options: { remarkPlugins: [reshootRemarkMdxImage] },\n          },\n        ],\n      },\n    ],\n  },\n};\n```\n\n### UI Component\n\n```jsx\n// entry-point.js\nimport '@reshoot/react/styles.css';\n```\n\n```jsx\n// Example.jsx\nimport imageMeta from '@reshoot/macro';\nimport Img from '@reshoot/react';\n\nexport default function Example() {\n  return \u003cImg meta={imageMeta('./image.png')} /\u003e;\n}\n```\n\n## Support\n\nThis library has been continuously used in many of my personal projects, and is regarded as production-ready. In the foreseeable future, I will continuously maintain and support this library.\n\n## Issues and Feedback\n\nPlease voice your opinion and report bugs in the [issues](https://github.com/billykwok/reshoot/issues) sections of this GitHub project.\n\n## Contributing\n\nYou are more than welcome to add more functionalities, improve documentation, fix bugs, and anything you think is needed. The build step is pretty self-explanatory. Please refer to [`package.json`](https://github.com/billykwok/reshoot/blob/main/package.json).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillykwok%2Freshoot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillykwok%2Freshoot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillykwok%2Freshoot/lists"}