Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nitedani/inspector-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nitedani/inspector-api - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

5

lib/cjs/heap.d.ts
/// <reference types="node" />
import { Session } from "inspector";
import { PassThrough } from "stream";
export default class Heap {

@@ -11,4 +12,4 @@ session: Session;

startTimeline(): Promise<void>;
stopTimeline(): Promise<string>;
takeSnapshot(): Promise<string>;
stopTimeline(): PassThrough;
takeSnapshot(): PassThrough;
}

51

lib/cjs/heap.js

@@ -23,2 +23,3 @@ "use strict";

const utils = __importStar(require("./utils"));
const stream_1 = require("stream");
class Heap {

@@ -45,32 +46,34 @@ session;

stopTimeline() {
return new Promise((resolve, reject) => {
const res = [];
const getChunk = (m) => {
res.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.stopTrackingHeapObjects", (err) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
if (err)
return reject(err);
resolve(res.join(""));
});
const stream = new stream_1.PassThrough();
const getChunk = (m) => {
stream.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.stopTrackingHeapObjects", (err) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
stream.emit("finish");
stream.emit("end");
stream.end();
if (err)
throw err;
});
return stream;
}
takeSnapshot() {
return new Promise((resolve, reject) => {
const res = [];
const getChunk = (m) => {
res.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.takeHeapSnapshot", undefined, (err, _r) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
if (err)
return reject(err);
resolve(res.join(""));
});
const stream = new stream_1.PassThrough();
const getChunk = (m) => {
stream.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.takeHeapSnapshot", (err, _r) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
stream.emit("finish");
stream.emit("end");
stream.end();
if (err)
throw err;
});
return stream;
}
}
exports.default = Heap;
/// <reference types="node" />
import { Session } from "inspector";
import { PassThrough } from "stream";
export default class Heap {

@@ -11,4 +12,4 @@ session: Session;

startTimeline(): Promise<void>;
stopTimeline(): Promise<string>;
takeSnapshot(): Promise<string>;
stopTimeline(): PassThrough;
takeSnapshot(): PassThrough;
}
import * as utils from "./utils";
import { PassThrough } from "stream";
export default class Heap {

@@ -23,31 +24,33 @@ session;

stopTimeline() {
return new Promise((resolve, reject) => {
const res = [];
const getChunk = (m) => {
res.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.stopTrackingHeapObjects", (err) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
if (err)
return reject(err);
resolve(res.join(""));
});
const stream = new PassThrough();
const getChunk = (m) => {
stream.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.stopTrackingHeapObjects", (err) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
stream.emit("finish");
stream.emit("end");
stream.end();
if (err)
throw err;
});
return stream;
}
takeSnapshot() {
return new Promise((resolve, reject) => {
const res = [];
const getChunk = (m) => {
res.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.takeHeapSnapshot", undefined, (err, _r) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
if (err)
return reject(err);
resolve(res.join(""));
});
const stream = new PassThrough();
const getChunk = (m) => {
stream.push(m.params.chunk);
};
this.session.on("HeapProfiler.addHeapSnapshotChunk", getChunk);
this.session.post("HeapProfiler.takeHeapSnapshot", (err, _r) => {
this.session.removeListener("HeapProfiler.addHeapSnapshotChunk", getChunk);
stream.emit("finish");
stream.emit("end");
stream.end();
if (err)
throw err;
});
return stream;
}
}
{
"name": "@nitedani/inspector-api",
"version": "0.0.1",
"version": "0.0.2",
"bin": "./index.js",

@@ -5,0 +5,0 @@ "types": "./index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc