Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bmeck
Created September 13, 2018 19:29
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 bmeck/6bfbe0f979d971501150002537cb911f to your computer and use it in GitHub Desktop.
Save bmeck/6bfbe0f979d971501150002537cb911f to your computer and use it in GitHub Desktop.
`node --experimental-policy policy.json checked.js` , from https://github.com/bmeck/node/tree/policy
console.log('typeof fs %s', typeof require('fs'));
{
"policies": {
"from_tool": {
"privileges": {
"dependencies": {
"fs": false
}
}
}
},
"resources": {
"file:///absolute/path/to/checked.js": {
"integrity": "sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0",
"policy": "from_tool"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment