crossvm

0.0.9-beta • Public • Published

Cross VM

Browser compatible Node VM

By using this library you will be able to containerize JS codes and evaluate the codes in the browser

Install

Sadly for now you can only use NPM to use this package.
(Webpack-bundle is coming)

npm install --save crossvm

Testing

Writing tests is in progress

Example

Look at Node's VM official documentation

Note

CrossVM is not a security mechanism. Do not use it to run untrusted code.
There is always a way to get out of sandbox like:

const {createContext, run} = require('crossvm');
const context = createContext();
run('"".constructor.constructor("return this")().console.log=()=> { throw new Error("pwnd");}', context);
console.log("Hello world");

(Thanks to Dark Marouane for clarifying this)

Readme

Keywords

Package Sidebar

Install

npm i crossvm

Weekly Downloads

8

Version

0.0.9-beta

License

MIT

Unpacked Size

108 kB

Total Files

34

Last publish

Collaborators

  • qti3e