# isolated-vm-inspector

> 本库是isolated-vm的调试扩展库,用于解决isolated-vm调试不能在首行断住的问题。

Latest version **1.0.7** (published 2023-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install isolated-vm-inspector
pnpm add isolated-vm-inspector
yarn add isolated-vm-inspector
bun add isolated-vm-inspector
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-09-26 |
| First published | 2023-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tzhiyuan |

## Links

- npm: https://www.npmjs.com/package/isolated-vm-inspector
- npm.io page: https://npm.io/package/isolated-vm-inspector

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) ^8.14.2

## Recent versions

- 1.0.7 (latest) — 2023-09-26
- 1.0.6 — 2023-09-26
- 1.0.5 — 2023-09-25
- 1.0.4 — 2023-09-25
- 1.0.3 — 2023-09-25
- 1.0.2 — 2023-09-25
- 1.0.1 — 2023-09-25
- 1.0.0 — 2023-09-25

## README

## 说明

本库是isolated-vm的调试扩展库,用于解决isolated-vm调试不能在首行断住的问题。

## 安装

npm  i  isolated-vm

npm  i  isolated-vm-inspector  

## 使用

```js
'use strict';
//引入isolated-vm
let ivm = require('isolated-vm'); 
//引入本库
let inspector = require('isolated-vm-inspector') 
//设置为inspector: true
let isolate = new ivm.Isolate({ inspector: true }); 
//设置为inspector: true
let context =  isolate.createContextSync({ inspector: true }); 
//创建两个script
let script =  isolate.compileScriptSync(`debugger;1`,{ filename: 'example1.js' });
let script1 =  isolate.compileScriptSync(`debugger;2`,{ filename: 'example2.js' });
//开启调试
//inspector(isolate:isolated-vm,options?:{port?:int,host?:string},func:async function)
inspector(isolate,{
    port: 9222,
    host: "127.0.0.1"
}, async ()=>{
    let r1 = await script.run(context);
    let r2 = await script1.run(context);
    debugger;
})
//然后浏览器打开 输出的链接
//devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9222

```



##

---
_Source: https://npm.io/package/isolated-vm-inspector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
