UNPKG

motion

Version:

motion - moving development forward

81 lines (80 loc) 3.56 kB
{ "_args": [ [ "vm-browserify@https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "vm-browserify@0.0.4", "_id": "vm-browserify@0.0.4", "_inCache": true, "_location": "/vm-browserify", "_phantomChildren": {}, "_requested": { "name": "vm-browserify", "raw": "vm-browserify@https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "rawSpec": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "scope": null, "spec": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "type": "remote" }, "_requiredBy": [ "/node-libs-browser" ], "_resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "_shasum": "5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73", "_shrinkwrap": null, "_spec": "vm-browserify@https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "mail@substack.net", "name": "James Halliday", "url": "http://substack.net" }, "bugs": { "url": "https://github.com/substack/vm-browserify/issues" }, "dependencies": { "indexof": "0.0.1" }, "description": "vm module for the browser", "devDependencies": { "tape": "~2.3.2" }, "homepage": "https://github.com/substack/vm-browserify#readme", "keywords": [ "browser", "eval", "vm" ], "license": "MIT", "main": "index.js", "name": "vm-browserify", "optionalDependencies": {}, "readme": "# vm-browserify\n\nemulate node's vm module for the browser\n\n[![testling badge](https://ci.testling.com/substack/vm-browserify.png)](https://ci.testling.com/substack/vm-browserify)\n\n# example\n\nJust write some client-side javascript:\n\n``` js\nvar vm = require('vm');\n\n$(function () {\n var res = vm.runInNewContext('a + 5', { a : 100 });\n $('#res').text(res);\n});\n```\n\ncompile it with [browserify](http://github.com/substack/node-browserify):\n\n```\nbrowserify entry.js -o bundle.js\n```\n\nthen whip up some html:\n\n``` html\n<html>\n <head>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></script>\n <script src=\"/bundle.js\"></script>\n </head>\n <body>\n result = <span id=\"res\"></span>\n </body>\n</html>\n```\n\nand when you load the page you should see:\n\n```\nresult = 105\n```\n\n# methods\n\n## vm.runInNewContext(code, context={})\n\nEvaluate some `code` in a new iframe with a `context`.\n\nContexts are like wrapping your code in a `with()` except slightly less terrible\nbecause the code is sandboxed into a new iframe.\n\n# install\n\nThis module is depended upon by browserify, so you should just be able to\n`require('vm')` and it will just work. However if you want to use this module\ndirectly you can install it with [npm](http://npmjs.org):\n\n```\nnpm install vm-browserify\n```\n\n# license\n\nMIT\n", "readmeFilename": "readme.markdown", "repository": { "type": "git", "url": "git+ssh://git@github.com/substack/vm-browserify.git" }, "scripts": { "test": "tap test/*.js" }, "testling": { "browsers": [ "android-browser/4.2..latest", "chrome/22..latest", "chrome/canary", "firefox/16..latest", "firefox/nightly", "ie/6..latest", "ipad/6.0..latest", "iphone/6.0..latest", "opera/12..latest", "opera/next", "safari/5.1..latest" ], "files": "test/*.js" }, "version": "0.0.4" }