{"_id":"@allenlee/rehype-image-process","_rev":"1-b1d05e3d3f3e7b8355df5a980fab7247","name":"@allenlee/rehype-image-process","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@allenlee/rehype-image-process","version":"0.0.2","description":"A [rehype](https://rehype.js.org/) plugin for processing image nodes to add blur effect and width/height in compile time","author":{"name":"Allen Lee","email":"648384410li@gmail.com"},"license":"MIT","type":"module","exports":"./index.js","repository":{"type":"git","url":"git+https://github.com/cangSDARM/rehype-image-process.git"},"bugs":{"url":"https://github.com/cangSDARM/rehype-image-process/issues"},"homepage":"https://github.com/cangSDARM/rehype-image-process#readme","funding":"https://github.com/sponsors/cangSDARM","keywords":["rehype","rehype-plugin","unified","image","blur","nextjs"],"engines":{"node":">=14.0.0"},"scripts":{"build":"tsc --noEmit false","test":"echo \"no test yet\""},"dependencies":{"plaiceholder":"^2.5.0","unist-util-visit":"^4.1.2"},"devDependencies":{"@types/mdast":"^3.0.0","@types/node":"*","eslint":"^8.0.0","eslint-plugin-jsx-a11y":"^6.0.0","prettier":"^2.0.0","typescript":"^4.0.0","unified":"^10.0.0"},"licenseText":"# MIT License\n\nCopyright © 2023 Allen Lee\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction,\nincluding without limitation the rights to use, copy, modify, merge, publish, distribute,\nsublicense, and/or sell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\nNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES\nOR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@allenlee/rehype-image-process@0.0.2","dist":{"shasum":"f2092d7c025895d7683d7dedc60915a4824c8e4d","integrity":"sha512-gtrzzeCOwl/Qoiko9Vqlon693SMB1YWqlDgivPB7v9RV3mG6WDbOtrGTQplDkA5q35QJK7FlxAXdWGKhehHvmQ==","tarball":"https://registry.npmjs.org/@allenlee/rehype-image-process/-/rehype-image-process-0.0.2.tgz","fileCount":6,"unpackedSize":7319,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9s3bde6jmMRCjWtfMicKyQbobXK21P0IK05MKQ4/PMAiBh6Rc3DMrHViQb1OP+LgnJ+t4Fp4x0LFl/dKSN9Cc5hw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkKqcoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCjw//XWSX1FRu/ieuiZH9N0d3cwnLlPYdsbWaDuV2J4E4S4E92obK\r\nAdJujkEn1UBMIV1eIBcs5+MgF4Qc5dNyt9fus1FtBF//AhZRy72CQVKvRFjq\r\nqMLO05L+wdJrnEutpTdhM3gXYOpBWWTqDrReDyAUkwXAQSdSTcQqDFZeaTpu\r\nWzhdPYy2xmZrE1x8goswBerZVUsF6X7LibWh9+z8vwBo9V2lvHk+ePps4P7j\r\n1sANLvoB9v7m1npUQHQNHyOYVeQX4p6SnzpNFhBVINZRxko3KIv5O6qwSGqd\r\neAU2bARphs0Xzh0mri/5G0lmjqwO5GVyeQwxVPrvrpqX5fjGuCGpwazvHItV\r\n5/Ra8LqW9aPTNEKc1sv6pRARUGlrqsz6vpM9+1VspBnwMSMYwXV6kVJiulW9\r\n6ReJ1ZPjAvcjetWeLW7gO+lkJWfzvhBO6dJJ69VAT23+gnDcg/q0esTyvcD6\r\nbgeHX7j3iaedkOxHlRhoxj+ht4ZWR2iDg1hktUlzKE18Zi8cvBVQV1MsT+Fv\r\nux9Y1u61GBV9jwMf4eCbHdZPP+UUFDN6GEMa+Y5yp2jf7EmO3dHttf+6yGGl\r\nT51oLwLRkgCAMHc9gxUR1pOh9AdYx7ChSyYudo6oQPpCY1ERFZemgcD0idnJ\r\nJov0l8VIQLYg3tF2U8IniGSMSRVB4vygLEM=\r\n=2C89\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"allenlee","email":"648384410li@gmail.com"},"directories":{},"maintainers":[{"name":"allenlee","email":"648384410li@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-image-process_0.0.2_1680516903890_0.16944929771456962"},"_hasShrinkwrap":false},"0.0.3":{"name":"@allenlee/rehype-image-process","version":"0.0.3","description":"A [rehype](https://rehype.js.org/) plugin for processing image nodes to add blur effect and width/height in compile time","author":{"name":"Allen Lee","email":"648384410li@gmail.com"},"license":"MIT","type":"module","exports":"./index.js","repository":{"type":"git","url":"git+https://github.com/cangSDARM/rehype-image-process.git"},"bugs":{"url":"https://github.com/cangSDARM/rehype-image-process/issues"},"homepage":"https://github.com/cangSDARM/rehype-image-process#readme","funding":"https://github.com/sponsors/cangSDARM","keywords":["rehype","rehype-plugin","unified","image","blur","nextjs"],"engines":{"node":">=14.0.0"},"scripts":{"build":"tsc --noEmit false","test":"echo \"no test yet\""},"dependencies":{"plaiceholder":"^2.5.0","unist-util-visit":"^4.1.2"},"devDependencies":{"@types/mdast":"^3.0.0","@types/node":"*","eslint":"^8.0.0","eslint-plugin-jsx-a11y":"^6.0.0","prettier":"^2.0.0","typescript":"^4.0.0","unified":"^10.0.0"},"licenseText":"# MIT License\n\nCopyright © 2023 Allen Lee\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and\nassociated documentation files (the \"Software\"), to deal in the Software without restriction,\nincluding without limitation the rights to use, copy, modify, merge, publish, distribute,\nsublicense, and/or sell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial\nportions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT\nNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES\nOR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@allenlee/rehype-image-process@0.0.3","dist":{"shasum":"c4f263f7ac4dac96588315b860234073906cd52e","integrity":"sha512-0jOOQog4BAek/El6D0vfgixfqoXJa7d+FIRLKc9emKUMo4n/qWQ3E0FkFuj01LUQKxoZYJ/tmc42+wDXuuAq1A==","tarball":"https://registry.npmjs.org/@allenlee/rehype-image-process/-/rehype-image-process-0.0.3.tgz","fileCount":6,"unpackedSize":7310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICECdle1WA/MPrPtO1jCweGJT9s2Utw8KoSW2trlf7oxAiApjxEaxALq3VFWQe3v38lpQd3MpVyWA9n3LNJcq1Vi8g=="}]},"_npmUser":{"name":"allenlee","email":"648384410li@gmail.com"},"directories":{},"maintainers":[{"name":"allenlee","email":"648384410li@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype-image-process_0.0.3_1690598471702_0.7075355580034293"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-03T10:15:03.759Z","0.0.2":"2023-04-03T10:15:04.047Z","modified":"2023-07-29T02:41:11.962Z","0.0.3":"2023-07-29T02:41:11.864Z"},"maintainers":[{"name":"allenlee","email":"648384410li@gmail.com"}],"description":"A [rehype](https://rehype.js.org/) plugin for processing image nodes to add blur effect and width/height in compile time","homepage":"https://github.com/cangSDARM/rehype-image-process#readme","keywords":["rehype","rehype-plugin","unified","image","blur","nextjs"],"repository":{"type":"git","url":"git+https://github.com/cangSDARM/rehype-image-process.git"},"author":{"name":"Allen Lee","email":"648384410li@gmail.com"},"bugs":{"url":"https://github.com/cangSDARM/rehype-image-process/issues"},"license":"MIT","readme":"# @allenlee/rehype-image-process\n\nA [rehype](https://rehype.js.org/) plugin for processing image nodes to add blur effect and\nwidth/height in compile time\n\nFor now, _Some properties are specific to nextjs_\n\nThe idea behind this plugin: https://ironeko.com/posts/how-to-blurred-images-on-load-in-next-js\n\n## Installation\n\n```sh\nnpm install @allenlee/rehype-image-process\n```\n\n## Options\n\n- `srcAsAlt`<br />\n  If there no alt exists, insert the transformed src to the alt<br/>\n  default: `true`\n- `blurDataURLPropertyName`<br />\n  The property name of the generated blur image base64 data<br/>\n  default: `blurDataURL`\n- `placeholderPropertyName`<br />\n  The property name of the placeholder (_for nextjs only_)<br/>\n  default: `blur`\n- `srcTransform(src per image)`<br />\n  Convert src of image before it is inserted to any\n  framework<br/>\n  default: `(src) => src`\n\n## Usage\n\n### Source\n\n```ts\nconst rehypeImageProcess = require('@allenlee/rehype-image-process');\n\nrehype().use(rehypeImageProcess).process(`\n![some alt](/cat.jpg)\n\ndog.jpg\n`);\n```\n\n### Yields\n\n```html\n<img\n  src=\"/cat.jpg\"\n  alt=\"some alt\"\n  width=\"500\"\n  height=\"500\"\n  sizes=\"(max-width: 500px) 100vw, 500px\"\n  blurDataURL=\"catblurbase64\"\n  placeholder=\"blur\"\n/>\n\n<!-- if you have some plugin can transform the image directly -->\n<img\n  src=\"/dog.jpg\"\n  alt=\"/dog.jpg\"\n  width=\"200\"\n  height=\"300\"\n  sizes=\"(max-width: 200px) 100vw, 300px\"\n  blurDataURL=\"dogblurbase64\"\n  placeholder=\"blur\"\n/>\n```\n\n### License\n\n[MIT](LICENSE.md) @ [Allen Lee](https://github.com/cangSDARM)\n","readmeFilename":"README.md"}