Compiled protection
Compile selected JavaScript functions.
Invite-only beta. Separate access is required.
Review a selection#
In Advanced / Compiled V3, review functions and set input/output types. Confirm private modules belong to you.
Numbers, booleans, bounded strings and typed arrays are supported. Ordinary objects, page updates and whole apps are not.
Offline mode#
Keep companion files with your browser or Node.js app. Missing or mismatched files stop startup without restoring original code.
Compiled files can still be inspected or copied. Server-side protection keeps selected code private.
Test and ship#
Test inputs, array changes, startup and Content Security Policy. Required unsupported selections stop the build.
Strings and bytes#
string supports comparisons, joining, length, searches, slice, substring and character reads. Server rules can stay private.
export function acceptedToken(token) {
return token.startsWith("paid:") && token.length < 40;
}
Choose one string input and a boolean result; review still applies.
Limits use JavaScript UTF-16 units: offline up to 4,096; online up to 128 per string and 256 string/array elements combined per call. Regex, locale/case conversion, automatic number conversion and dynamic character indexing are unsupported.
u8_array needs a fixed Uint8Array with its own attached buffer. Changes copy back after success. Shared/detached buffers fail. Test the declared shape.
Fixed typed arrays also support for…of with a let or const value. Private read-only tables support iteration, searches and slice. Custom iterators, destructuring and for await are unsupported. Word-based rules can use Math.clz32.
Calls need enough memory budget for inputs, private state and temporary arrays.
Private modules#
Reviewed ESM modules and stable CommonJS require/export patterns can share private helpers. CommonJS currently uses offline Node.js output. Dynamic imports, dynamic require, export mutation and module cycles are rejected. Parsing a file does not prove its functions are safe to compile; review and declared types still apply.