关于
🚀 快速、可靠且易于使用的 JavaScript 到可执行文件编译器。
开发工具可以做什么
- Different than the others - Astra is a new approach to compiling JavaScript/TypeScript applications. It uses a different method than other compilers like pkg or nexe.
- Compile newest versions of Node.js - Astra supports the latest Node.js versions.
- Fast build time - Powered by esbuild, Astra ensures the fastest possible compilation speed.
- Improved support for ECMAScript - Astra supports compiling ESM-based applications, with workarounds for limitations in Node.js SEA.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Astra
🚀 Fast, reliable and easy-to-use js-to-exe compiler.
Why Astra?
Astra is (probably) the best compiler available on npm.
Average exe is ~70-80MB (depends on your code) so it's lighter than most compilers
Using upx you can go down up to ~30MB
It's aiming to compile servers (express, fastify) or CLIs (commander) so it's not replacement of electron.
For now it only compiles windows applications. (I'm working on macOS and linux)
Features
Different than the others - Astra is a new approach to compiling JavaScript/TypeScript applications. It uses a different method than other compilers like pkg or nexe.
Compile newest versions of Node.js - Astra supports the latest Node.js versions.
Fast build time - Powered by esbuild, Astra ensures the fastest possible compilation speed.
Improved support for ECMAScript - Astra supports compiling ESM-based applications, with workarounds for limitations in Node.js SEA.
Delightful DX - With signale, inquirer and chalk, Astra provides a great developer experience.
Standalone Executable - Generates a single
.exeor binary file that includes all dependencies.Make exe your own - Modify metadata (icon, name, version, etc.) of the generated executable.
Future-proof - Made with trusted, constantly evolving tools.
Compared to others
| Name | astra | pkg | nexe |
|---|---|---|---|
| Latest supported version | Node 24 | Node 18 | Node 14 |
| Supports ESM | ✅ | ❌ | ❌ |
| Built-in metadata edit | ✅ | ❌ | ❌ |
| Output size | ~75MB | ~90MB | ~90MB |
| Bundles code | ✅ | ❌ | ❌ |
| Building Speed | ⚡ Fast | ⚡⚡ Very Fast | ⚡⚡ Very Fast |
| Stars | |||
| Difficulty | 🟢 Easy | 🟡 Medium | 🟡 Medium |
| Maintained | ✅ | ❌ (Archived) | 🟡 Low activity |
| TypeScript Support | ✅ | ❌ (requires manual building) | ❌ (requires manual building) |
Contributing
🤝 I welcome pull requests! Every contribution will be reviewed and appreciated - even small fixes.
Getting Started
Install Astra globally using Yarn or npm:
# npm
npm i -g astra-cli
# yarn (classic)
yarn global add astra-cli
# pnpm
pnpm add -g astra-cli
# for one project only
# npm
npm i --save-dev astra-cli
# yarn
yarn add --dev astra-cli
# pnpm
pnpm add -D astra-cli
Then, compile your JavaScript/TypeScript project:
astra build src/index.js
For more options, run:
astra --help
How it works?
- Code is checked and bundled with esbuild,
- Then astra is generating blob which will be injected into node.exe binary,
- Next astra is editing metadata of your binary (adding icon, copyright),
- And finally postject injects blob into final executable.
License
Astra is licensed under the MIT License.
Made with ❤️ by QwertyCodeQC
探索相关项目
加载中…