Skip to content

Not Supported

Pure does not embed a JavaScript engine. Features that require dynamic code evaluation, runtime introspection of the JS engine, or direct V8/JavaScriptCore APIs do not work. This page lists specific unsupported features so you can plan accordingly.

FeatureStatusAlternative
eval(code)Rewrite as a static function
new Function(body)Rewrite as a static function
import(expr) with a variable pathUse static import or require()
require(variable)Use static require('./path')
vm.runInContext, vm.ScriptNot applicable

The compiler resolves all imports statically at compile time. Dynamic import paths (e.g. require(process.env.PLUGIN)) cannot be resolved and will cause a compile error.

Dynamic import() with a constant string literal works:

// ✅ This works — the path is a constant
const mod = await import('./plugins/default.js');
// ❌ This does not work — the path is a variable
const mod = await import(`./plugins/${name}.js`);
ModuleStatus
node:vm❌ Requires a JS engine
node:inspector❌ V8-specific
node:repl❌ Requires a JS engine
node:wasi❌ Not implemented
node:domain❌ Deprecated; not implemented
node:sqlite❌ Use better-sqlite3 instead

Third-party native add-ons that use the Node-API (N-API / node-addon-api) may work if the binary interface is compatible with Pure’s runtime. Many popular add-ons (e.g. better-sqlite3, sharp) work without modification. Add-ons that use internal V8 headers or Node internals will not work. See npm packages → Native add-ons for details.

APINotes
Bun.serve()Use node:http or node:net instead
Bun.file()Use node:fs instead
Bun.build()Not applicable in Pure
Bun.password.*Use node:crypto (pbkdf2, scrypt, argon2 via npm package)
Bun.sqlUse better-sqlite3 or another npm SQL client
Bun.redisUse the redis npm package
import.meta.dirUse __dirname
import.meta.mainUse require.main === module

__dirname and __filename are set to the source file’s directory and path at compile time, not the directory of the running binary. This means:

// Returns the source directory, not where the binary lives at runtime
console.log(__dirname);

To get the directory of the running binary at runtime, use:

import { dirname } from 'node:path';
const binaryDir = dirname(process.execPath);

Stack traces in compiled binaries include source file names and line numbers from the original TypeScript/JavaScript source. The exact format differs from Node.js stack traces — libraries that parse stack trace strings (e.g. source-map-support) may not work correctly.

process.versions.node is not set. Code that branches on process.versions.node may behave differently. Use process.versions.pure to detect a Pure runtime programmatically:

if (process.versions.pure) {
// running in a Pure-compiled binary
}
FeatureStatus
experimentalDecorators✅ Supported (reflect-metadata partially supported)
emitDecoratorMetadata⚠️ Partial — metadata is available but type information is limited
allowArbitraryExtensions✅ Supported