@forzalabs/remora
Version:
A powerful CLI tool for seamless data translation.
21 lines (20 loc) • 747 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_v8_1 = __importDefault(require("node:v8"));
class RuntimeClass {
constructor() {
this.getHeap = () => {
const { heap_size_limit, used_heap_size } = node_v8_1.default.getHeapStatistics();
return {
heapSizeMB: this._toMB(heap_size_limit),
usedHeapMB: this._toMB(used_heap_size)
};
};
this._toMB = (bytes) => Math.round(bytes / (1024 * 1024) * 100) / 100;
}
}
const Runtime = new RuntimeClass();
exports.default = Runtime;