{"id":25804458,"url":"https://github.com/byk/fossilize","last_synced_at":"2025-02-27T18:36:30.723Z","repository":{"id":276883838,"uuid":"930609342","full_name":"BYK/fossilize","owner":"BYK","description":"Create Node SEA binaries across platforms with ease","archived":false,"fork":false,"pushed_at":"2025-02-21T14:17:10.000Z","size":140,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T14:54:37.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BYK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-10T23:02:06.000Z","updated_at":"2025-02-21T14:16:58.000Z","dependencies_parsed_at":"2025-02-11T00:30:59.371Z","dependency_job_id":null,"html_url":"https://github.com/BYK/fossilize","commit_stats":null,"previous_names":["byk/fossilize"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Ffossilize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Ffossilize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Ffossilize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BYK%2Ffossilize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BYK","download_url":"https://codeload.github.com/BYK/fossilize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241045134,"owners_count":19899605,"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":[],"created_at":"2025-02-27T18:36:30.137Z","updated_at":"2025-02-27T18:36:30.710Z","avatar_url":"https://github.com/BYK.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fossilize\n\nCreate self-contained binaries for all platforms supported by Node.js using [Node SEA][1].\n\n## Usage\n\n### With `npx`\n\nIn the root of your Node.js project\n\n```shell\nnpx fossilize\n```\n\nor just give it your entrypoint file\n\n```shell\nnpx fossilize main.js\n```\n\n### As a dev dependency\n\nIt is also possible to use fossilize as a dev dependency. Add it to your project first:\n\n```shell\nnpm add --save-dev fossilize\n```\n\nand then add a `compile` script to your project referencing fossilize:\n\n```json\n{\n   \"scripts\": {\n      \"compile\": \"fossilize -a some.html -n lts\"\n   }\n}\n```\n\n## What is it?\n\nFossilize is a tool to create Node SEAs (Single Executable Applications)\nfor different platforms. It bundles your Node.js application and its dependencies\ninto a single CJS file using `esbuild`. Then creates a self-contained binary from\nthat using the [Node SEA][1] feature.\n\nIt also supports embedding assets either file by file, from a directory, or\nthrough a Vite manifest.\n\n## Why?\n\n### Why would I want a single-executable Node.js application?\n\nIf you are building a CLI application using Node.js, it becomes a challenge to\ndistribute it. You may rely on `npx` which requires Node.js but you'd also need\nto make sure your app works with many Node.js versions. Your tool being written\nin JS does not necessarily mean it is for Node.js users but it would require\nNode.js on their system. With Node SEA, you just give them a self-contained\nbinary without any other system requirements (except for `libc`) and you are\ndone.\n\nAlternatively, you might be developing a server application that you want to\ndistribute and deploy using Docker. Now you need to maintain a Docker image\nbuild pipeline, optimize the image building process based on dependencies,\nlearn how to minimize image size by deleting package manager caches etc.\nOn the other hand, if you distribute your application as a Node SEA, then\nall you need to do is copy a single binary into a base Linux distro image\nthat has `libc` (sorry Alpine) and you are good to go.\n\n### Why do I need `fossilize`?\n\nIf you go check the documentation for Node SEA, not only you'd see that it is\nmarked as \"under active development\", you'd also realize that there are these\nmanual and hand-wavy steps that you need to follow to build a Node SEA binary.\nJust the macOS signing part is a big discovery journey itself whereas if you\nare using [Deno][3] for instance, it is just [`deno compile`][4].\n\n_Yes, we can improve the docs and we probably should but an automated tool is still better._\n\n### Why is `fossilize` itself not a Node SEA?\n\nOh the irony! I actually tried but there are two main blockers right now:\n\n1. I want to include a bundler and both `esbuild` and `rollup` have native\n   components. They do support and have WASM so this is still possible but\n   I just didn't have that time to work on this yet.\n2. [postject][5], the library we use to inject your app into the Node.js binary\n   gets confused if you try to inject itself (or some code contains itself).\n   This is most probably solvable with a pull request but that requires time\n   like the item above, which I've yet to spend.\n\n## Notes\n\nCurrently, it supports signing macOS binaries which is required for them to run\non any system. It uses [`rcodesign`][2] for this through the following env variables:\n\n- `APPLE_TEAM_ID`\n- `APPLE_CERT_PATH`\n- `APPLE_CERT_PASSWORD`\n- `APPLE_API_KEY_PATH`\n\nFurther documentation will be added about how to obtain and use these.\n\n[1]: https://nodejs.org/api/single-executable-applications.html#single-executable-applications\n[2]: https://github.com/indygreg/apple-platform-rs/releases\n[3]: https://deno.com/\n[4]: https://docs.deno.com/runtime/reference/cli/compile/\n[5]: https://www.npmjs.com/package/postject\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyk%2Ffossilize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyk%2Ffossilize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyk%2Ffossilize/lists"}