{"id":28573701,"url":"https://github.com/remarkjs/remark-embed-images","last_synced_at":"2025-06-10T21:19:31.598Z","repository":{"id":22811961,"uuid":"97238898","full_name":"remarkjs/remark-embed-images","owner":"remarkjs","description":"plugin to embed local images as data URIs","archived":false,"fork":false,"pushed_at":"2024-10-22T12:37:24.000Z","size":246,"stargazers_count":35,"open_issues_count":0,"forks_count":6,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-09T11:51:31.056Z","etag":null,"topics":["image","markdown","remark","remark-plugin"],"latest_commit_sha":null,"homepage":"https://remark.js.org","language":"JavaScript","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/remarkjs.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified"},"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-14T13:52:30.000Z","updated_at":"2025-04-12T12:38:38.000Z","dependencies_parsed_at":"2024-06-18T19:39:57.448Z","dependency_job_id":null,"html_url":"https://github.com/remarkjs/remark-embed-images","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.08791208791208793,"last_synced_commit":"7bf4fd8aef99f242401e5efee748367659a1f7c7"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-embed-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-embed-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-embed-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-embed-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-embed-images/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-embed-images/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152785,"owners_count":22813227,"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":["image","markdown","remark","remark-plugin"],"created_at":"2025-06-10T21:19:06.481Z","updated_at":"2025-06-10T21:19:31.567Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# remark-embed-images\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to embed local images as data URIs.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`unified().use(remarkEmbedImages)`](#unifieduseremarkembedimages)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin that inlines images as data\nURIs.\n\n## When should I use this?\n\nYou can use this package when you want to move markdown that references local\nimages around more easily, because images will be inlined.\nThis does makes the markdown quite hard to read and isn’t supported everywhere\n(such as GitHub), because data URIs might result in security risks.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 18+), install with [npm][]:\n\n```sh\nnpm install remark-embed-images\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkEmbedImages from 'https://esm.sh/remark-embed-images@5'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkEmbedImages from 'https://esm.sh/remark-embed-images@5?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have an image [`foo.png`][file-foo-png] and next to it the following\nfile `example.md`:\n\n```markdown\n![A pink square](./foo.png)\n```\n\n…and a module `example.js`:\n\n```js\nimport {remark} from 'remark'\nimport remarkEmbedImages from 'remark-embed-images'\nimport {read} from 'to-vfile'\n\nconst file = await read('example.md')\n\nawait remark()\n  .use(remarkEmbedImages)\n  .process(file)\n\nconsole.log(String(file))\n```\n\n…then running `node example.js` yields:\n\n```markdown\n![A pink square](data:image/png;base64,iVBORw0…)\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkEmbedImages`][api-remark-embed-images].\n\n### `unified().use(remarkEmbedImages)`\n\nEmbed local images as data URIs.\n\n###### Parameters\n\nThere are no options.\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `remark-embed-images@5`,\ncompatible with Node.js 18.\n\nThis plugin works with `unified` version 6+ and `remark` version 7+.\n\n## Security\n\nAlways be careful with user input.\nFor example, it’s possible to hide JavaScript inside images (such as GIFs,\nWebPs, and SVGs).\nUser provided images open you up to a [cross-site scripting (XSS)][wiki-xss]\nattack.\n\n## Related\n\n* [`remarkjs/remark-images`](https://github.com/remarkjs/remark-images)\n  — add a simpler image syntax\n* [`remarkjs/remark-unwrap-images`](https://github.com/remarkjs/remark-unwrap-images)\n  — remove the wrapping paragraph for images\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [David Herges][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/remarkjs/remark-embed-images/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-embed-images/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-embed-images.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-embed-images\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-embed-images.svg\n\n[downloads]: https://www.npmjs.com/package/remark-embed-images\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-embed-images\n\n[size]: https://bundlejs.com/?q=remark-embed-images\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://spektrakel.de\n\n[remark]: https://github.com/remarkjs/remark\n\n[typescript]: https://www.typescriptlang.org\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[file-foo-png]: test/fixtures/foo/foo.png\n\n[api-remark-embed-images]: #unifieduseremarkembedimages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-embed-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-embed-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-embed-images/lists"}