{"id":13666981,"url":"https://github.com/browserify/vm-browserify","last_synced_at":"2025-10-13T17:09:23.176Z","repository":{"id":2577380,"uuid":"3557987","full_name":"browserify/vm-browserify","owner":"browserify","description":"require('vm') like in node but for the browser","archived":false,"fork":false,"pushed_at":"2024-12-21T09:59:14.000Z","size":38,"stargazers_count":203,"open_issues_count":14,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-04T19:54:45.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/vm-browserify","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2012-02-27T06:36:15.000Z","updated_at":"2025-05-23T03:10:00.000Z","dependencies_parsed_at":"2025-01-16T13:34:00.259Z","dependency_job_id":"37fd1618-53d3-4bb6-affc-0087b538662a","html_url":"https://github.com/browserify/vm-browserify","commit_stats":{"total_commits":41,"total_committers":9,"mean_commits":4.555555555555555,"dds":0.6097560975609756,"last_synced_commit":"033537b20cec686adecaa4dde61c91134d59bc41"},"previous_names":["substack/vm-browserify"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/browserify/vm-browserify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fvm-browserify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fvm-browserify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fvm-browserify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fvm-browserify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/vm-browserify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fvm-browserify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009931,"owners_count":26084668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T07:00:20.726Z","updated_at":"2025-10-13T17:09:23.130Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":["https://tidelift.com/funding/github/npm/vm-browserify"],"categories":["javascript interpreters"],"sub_categories":["old projects"],"readme":"# vm-browserify\n\nemulate node's vm module for the browser\n\n[![Build Status](https://travis-ci.org/browserify/vm-browserify.svg?branch=master)](https://travis-ci.org/browserify/vm-browserify)\n\n# example\n\nJust write some client-side javascript:\n\n``` js\nvar vm = require('vm');\n\nwindow.addEventListener('load', function () {\n    var res = vm.runInNewContext('a + 5', { a : 100 });\n    document.querySelector('#res').textContent = 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\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"/bundle.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    result = \u003cspan id=\"res\"\u003e\u003c/span\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fvm-browserify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fvm-browserify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fvm-browserify/lists"}