TE
테크에코
홈24시간 인기최신베스트질문쇼채용
GitHubTwitter
홈

테크에코

Next.js로 구축된 기술 뉴스 플랫폼으로 글로벌 기술 뉴스와 토론을 제공합니다.

GitHubTwitter

홈

홈최신베스트질문쇼채용

리소스

HackerNews API원본 HackerNewsNext.js

© 2025 테크에코. 모든 권리 보유.

Show HN: Astra – a new js2exe compiler

60 포인트작성자: qwertycodepl5일 전
Hi everyone I&#x27;m new here and i wanted to introduce my project i&#x27;ve been working on. Astra is a simple but powerful node.js to exe compiler. It uses esbuild and Node SEA. It uses postject to inject your code to nodejs binary. It focuses more on compiling cli and Servers like pkg or nexe (express) than fullstack applications like electron or tauri. It has rich ESM and typescript support. It has good DX and cli UX. I made it bc i didn&#x27;t like using pkg or nexe, they cause a lot of problems with esm.<p>LIMITATIONS: Now it has problems compiling projects with depencides containing binaries (e.g. bcrypt, rcedit), and it compiles only for Windows but i&#x27;m working on it<p>If you like it, leave a and comment what you think about it!

9 comments

Vorh5일 전
Looks like a good start. A few notes:<p>- The first thing on the &quot;features&quot; list should be something that other compilers cannot do. Esthetics (maybe just say &quot;DX&quot;?) is a nice to have - sometimes VERY nice to have - but should not be positioned as the most important item.<p>As the original post says the alternatives have poor ESM support - that&#x27;s a good differentiator.<p>- Even though ES Modules are part of the ECMAScript standard, having a header stating &quot;(Partial) Support for ECMAScript&quot;- to me, at least - indicates the project does not support base JS features, not that ESM imports have problems. Maybe say &quot;improved ESM support&quot;?<p>- Docs seem a little bare. For example, the Usage section says:<p><pre><code> # Preinstall Node.js on the target machine astra install </code></pre> Which machine is the &quot;target&quot; machine? I would assume, in the context of compiling, that the target would be the machine you are compiling for... but installing software remotely seems out of scope. Does it install it locally, or swap the bundled installation in the .exe?<p>Also, no mention of binary limitations in actual docs, despite mention in post.<p>Hopefully this does not come off as discouraging - this looks like a good project.
评论 #44043127 未加载
quotemstr5일 전
This is not a compiler. It is doing no program translation. No register allocation. No parsing. No linking. It in no way resembles a compiler. Not every program that produces an executable file is a compiler just because <i>some</i> programs you may have heard of, like gcc, <i>are</i> in fact compilers.<p>I wish the JS universe would stop inventing new and wrong names for things.<p>(That said, this thing is at least using postject for actual insertion of the payload blob into the target executable, and based on its README, postjecth as the good taste to embed data as PE&#x2F;ELF&#x2F;Mach-O sections instead (as Bun does) of just YOLOing the attachment with cat.)
评论 #44044541 未加载
jasonjmcghee5일 전
To understand the underlying architecture- is my understanding correct that this runs esbuild to bundle then bundles that with node runtime and creates a binary that executes &quot;node index.js&quot;?
评论 #44042825 未加载
zamadatix5일 전
Very interesting. The readme notes &quot;Different than the others - Astra is a new approach to compiling JavaScript&#x2F;TypeScript applications. It uses a different method than other compilers like pkg or nexe.&quot; but never really explains what the difference is. Is it just that the code is run through esbuild before the SEA step or is there some other &quot;magic sauce&quot;?
评论 #44044481 未加载
TheRealPomax5일 전
You probably want to put that information in your README.md, because there is barely any information in the readme, and the docs look to be a placeholder atm =)
评论 #44042836 未加载
dpcan5일 전
This is really interesting, got it up and running very quickly.<p>I&#x27;m not sure what the use case is and it doesn&#x27;t auto-load chromium with its own web server from what I can tell. Is it just for creating javascript CLI utilities?
评论 #44045648 未加载
xhbxbsbebs4일 전
I don&#x27;t get it, does this project do anything other than embedding js and node in a single executable?<p>Nothing wrong with that, but why call it a compiler instead of bundler which would make the intension obvious
评论 #44056146 未加载
belmarca5일 전
I clicked on this hoping for an actual compiler. However from what I can see this is a bundler. The name is confusing.
评论 #44042937 未加载
评论 #44043523 未加载
thot_experiment5일 전
&gt; Average exe is ~70-80MB (depends on your code) so it&#x27;s lighter than most compilers<p>I know it&#x27;s JS not actually a compiler but a bundler that just packs node in with your code, but I still had a nice laugh at 80mb being light. I suppose that&#x27;s where the overton window is in a world of 1gb node_modules folders.<p>I wish there was a middle ground between this sort of thing and QuickJS (which is <i>actually</i> light, but has a lot of rough edges when it comes to its filesystem and network interfaces)
评论 #44043843 未加载
评论 #44043767 未加载
评论 #44044194 未加载