User Tools

Site Tools


smalljs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
smalljs [2026/08/12 18:24] – [SmallJS] donaldsmalljs [2026/08/12 19:19] (current) – [Installing] donald
Line 4: Line 4:
  
  
-==== Installing ====+==== How to Install SmallJS on Windows ====
 <code> <code>
-How to Install SmallJS on Windows 
- 
 SmallJS is a Smalltalk-to-JavaScript compiler. Here’s the official way to install it on Windows: SmallJS is a Smalltalk-to-JavaScript compiler. Here’s the official way to install it on Windows:
 1. Install Prerequisites 1. Install Prerequisites
Line 55: Line 53:
     You should have Smalltalk syntax highlighting and debugging support.     You should have Smalltalk syntax highlighting and debugging support.
 </code> </code>
 +
 +
 +
 +==== Compile JavaScript into a standalone .exe file on Windows. ====
 +<code>
 +Here are the best current options (as of 2026):
 +
 +1. Official Node.js SEA (Single Executable Applications) – Recommended
 +Node.js has built-in support for creating single executables.
 +
 +Pros: Official, no third-party tools needed (in recent versions), relatively small size.  
 +Cons: Still evolving; best with CommonJS (or bundled code).
 +
 +Basic steps:
 +1. Bundle your app first (recommended)
 +npx ncc build index.js -o dist
 +
 +2. Create config
 +echo '{"main":"dist/index.js","output":"myapp.exe"}' > sea-config.json
 +
 +3. Build the executable (Node 20+)
 +node --experimental-sea-config sea-config.json
 +
 +Newer Node versions (25+) have even simpler --build-sea support.
 +
 +2. Bun (Easiest & Fastest)
 +bun build ./index.js --compile --outfile myapp.exe
 +Very simple and produces a real standalone executable.
 +
 +3. Other Popular Tools
 +
 +| Tool              | Type              | Ease | Notes                              | Best For          |
 +|-------------------|-------------------|------|------------------------------------|-------------------|
 +| Bun           | Runtime           | ★★★★★ | One command                        | Most projects     |
 +| Node.js SEA   | Official          | ★★★★  | Built into Node                    | Pure Node apps    |
 +| pkg (yao-pkg) | Packager          | ★★★★  | Mature, supports assets            | Complex apps      |
 +| nexe          | Packager          | ★★★   | Older but still works              | Simple scripts    |
 +| Electron      | Framework         | ★★★   | Full desktop app + GUI             | GUI applications  |
 +| NW.js         | Framework         | ★★★   | Similar to Electron                | GUI applications  |
 +
 +Quick Recommendation
 +
 +Simple script / CLI tool* → Use *Bun** (bun build --compile)
 +Pure Node.js app* → Use *Node.js SEA**
 +App with GUI* → Use *Electron** + electron-builder / electron-packager
 +Maximum compatibility* → Use *pkg**
 +
 +Would you like a complete step-by-step guide for one of these methods (e.g. Bun or official Node SEA)?
 +</code>
 +
smalljs.1786559056.txt.gz · Last modified: 2026/08/12 18:24 by donald