Skip to content

Instantly share code, notes, and snippets.

@tgrecojs
Forked from degrammer/index.js
Last active January 19, 2024 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgrecojs/04ffbabf552df0a6a4463447b2da0d9b to your computer and use it in GitHub Desktop.
Save tgrecojs/04ffbabf552df0a6a4463447b2da0d9b to your computer and use it in GitHub Desktop.
lockdown example
#!/usr/bin/env node
import 'ses';
lockdown();
const isFrozen = x => Object.isFrozen(x);
const c1 = new Compartment({ console, Date });
c1.evaluate(`
console.log(globalThis);
return {name: 'super secret secure string'}
`);
{
"name": "quick-server",
"version": "1.0.0",
"bin": "./index.js",
"dependencies": {
"ses": "1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment