{"id":15772174,"url":"https://github.com/leighmcculloch/deno-embed","last_synced_at":"2026-04-21T22:35:42.832Z","repository":{"id":57675659,"uuid":"476612118","full_name":"leighmcculloch/deno-embed","owner":"leighmcculloch","description":"Embed files into demo applications by embedding them into a JSON file and importing natively into the demo app.","archived":false,"fork":false,"pushed_at":"2022-04-02T04:35:43.000Z","size":13,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-03T19:26:40.561Z","etag":null,"topics":["deno","embed"],"latest_commit_sha":null,"homepage":"https://deno.land/x/embed","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/leighmcculloch.png","metadata":{"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}},"created_at":"2022-04-01T07:09:31.000Z","updated_at":"2025-01-01T17:35:07.000Z","dependencies_parsed_at":"2022-09-26T20:41:37.171Z","dependency_job_id":null,"html_url":"https://github.com/leighmcculloch/deno-embed","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/leighmcculloch/deno-embed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leighmcculloch%2Fdeno-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leighmcculloch%2Fdeno-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leighmcculloch%2Fdeno-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leighmcculloch%2Fdeno-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leighmcculloch","download_url":"https://codeload.github.com/leighmcculloch/deno-embed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leighmcculloch%2Fdeno-embed/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263376125,"owners_count":23457333,"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":["deno","embed"],"created_at":"2024-10-04T15:21:05.055Z","updated_at":"2026-04-21T22:35:37.808Z","avatar_url":"https://github.com/leighmcculloch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-embed\n\n[![](https://img.shields.io/badge/-deno.land/x/embed-lightgrey.svg?logo=deno\u0026labelColor=black)](https://deno.land/x/embed)\n\nEmbed files into deno applications by embedding them into a JSON file and importing natively into the deno app.\n\nCLI: https://deno.land/x/embed/cli.ts  \nMod: https://deno.land/x/embed/mod.ts\n\n## Usage\n\n### CLI\n\n```\ndeno run --allow-read --allow-write \\\n    https://deno.land/x/embed/cli.ts \\\n    -i dir1 -i dir2 \\\n    -o embed.json\n```\n\n### Import\n\n```ts\nimport embed from \"./embed.json\" assert { type: \"json\" };\nconsole.log(embed[\"dir1/file1\"].contents);\n```\n\n### Import using Embed\n\n[![](https://img.shields.io/badge/-Embed%20docs-lightgrey.svg?logo=deno\u0026labelColor=black)](https://doc.deno.land/https://deno.land/x/embed/mod.ts/~/Embed)\n\n```ts\nimport { Embed } from \"https://deno.land/x/embed/mod.ts\";\nimport embedObj from \"./embed.json\" assert { type: \"json\" };\nconst embed = Embed.from(embedObj);\n\n// Read a file into a Uint8Array.\n_ = embed.readFile(\"dir1/file1\");\n\n// Read a text file into a string.\n_ = embed.readTextFile(\"dir1/file2\");\n\n// Walk a directory structure.\nfor (const entry of embed.walk(\"dir1\")) {\n    // ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleighmcculloch%2Fdeno-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleighmcculloch%2Fdeno-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleighmcculloch%2Fdeno-embed/lists"}