MCPcopy Index your code
hub / github.com/egoist/virtual-module

github.com/egoist/virtual-module @v0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.0 ↗ · + Follow
8 symbols 19 edges 2 files 0 documented · 0% updated 3y agov0.4.0 · 2020-02-24★ 62
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

virtual-module

NPM version NPM downloads CircleCI chat

Evaluate a module in sandbox. This package is extracted and modified from vue-server-renderer.

Install

yarn add virtual-module

Usage

const { createModule } = require('virtual-module')

const evaluate = createModule({
  'entry.js': `
    const isThree = require('is-three.js')
    module.exports = context => isThree(context.a + context.b)
  `,
  'is-three.js': `
    module.exports = input => input === 3
  `
})

evaluate('entry.js')({ a: 1, b: 2 })
//=> true

evaluate('is-three.js')(4)
//=> false

API

https://virtual-module.egoist.sh

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

virtual-module © EGOIST, Released under the MIT License.

Authored and maintained by EGOIST with help from contributors (list).

egoist.sh · GitHub @EGOIST · Twitter @_egoistlily

Extension points exported contracts — how you extend this code

Files (Interface)
(no doc)
src/index.ts
Options (Interface)
(no doc)
src/index.ts

Core symbols most depended-on inside this repo

createSandbox
called by 1
src/index.ts
compileModule
called by 1
src/index.ts
getCompiledScript
called by 1
src/index.ts
evaluateModule
called by 1
src/index.ts
createModule
called by 1
src/index.ts
r
called by 0
src/index.ts

Shape

Function 6
Interface 2

Languages

TypeScript100%

Modules by API surface

src/index.ts8 symbols

For agents

$ claude mcp add virtual-module \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact