
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Compile your Node.js project into an executable
npm install
to deploy
your application. Deploy it as a single independent filenpm install -g enclose
Run enclose
without arguments to see help.
In short, as input you specify the entry file of your project
/path/app.js
. As output you get a standalone executable
/path/app
. When it is run, it does the same as node /path/app.js
Command line call ./app a b
is equivalent to node ./app.js a b
The compiler parses your sources, detects calls to require
, traverses
the dependencies of your project and includes them into the executable.
You don't need to list them manually.
If your project has assets (HTML templates, CSS, etc), for example to serve via HTTP, you can bundle them into the executable. Just list them as a glob in the configuration file.
Both Yes and No.
Yes. Because JavaScript code is transformed into native code at compile-time using V8 internal compiler. Hence, your sources are not required to execute the binary, and they are not packaged.
No. Optimized native code can be generated only at run-time, using information collected at run-time. Without that information EncloseJS can generate only "unoptimized" code. It runs about 2x slower, than optimized one.
Also, Node.js code is put inside the executable (along with your code) to support Node.js API for your application at run-time. This increases output file size.
So, this is not that static compilation we used to know. But nevertheless you get fully functional binary without sources. Also, performance and file size overhead are vectors of future work.
The code protection is as strong as possible when the sources are compiled to native code. Hackers will deal with that push-mov stuff. No need to obfuscate, no need to encrypt, no "hidden" decryption keys. Also
myfunc.toString()
function myfunc() { [native code] }
You can choose what runtime version to wrap your project in - 0.12.x, 4.2.x or 5.x.
EncloseJS project does not aim to add new features to Node.js - to avoid undesirable issues, to have predictable stability and to make Node.js native modules compatible with enclosed executables.
It takes seconds to make an executable. You don't need to build Node.js from sources in order to make the binary. EncloseJS is shipped with precompiled parts, ready for bundling.
Projects like npm
, browserify
, eslint
can be compiled using EncloseJS (see
examples directory).
Probably, your existing project can be compiled too, with minimal
adjustments. The adjustments preserve the ability to run you project
via node ./app.js
EncloseJS can build executables for Linux, Windows and Mac OS X. Cross compilation is not currently supported, but will be supported in future.
Native modules (.node files) are supported for all platforms (more info, serialport example, oracle example).
dlopen
against the copy. This workaround will be deprecated soon.Proprietary.
1.1.0 (2016-01-28)
FAQs
Compile your Node.js project into an executable
The npm package enclose receives a total of 40 weekly downloads. As such, enclose popularity was classified as not popular.
We found that enclose demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.