لا يعتمد Elide على V8، لكنه يوفر واجهة توافق صغيرة للحزم التي تفحص إحصاءات الكومة أو تسلسل البيانات البسيطة.
| العملية | السلوك |
|---|---|
cachedDataVersionTag() | يعيد وسمًا ثابتًا بطول 32 بت للملف الثنائي الجاري. |
getHeapStatistics() | يعيد كائن إحصاءات الكومة بشكل Node. |
getHeapSpaceStatistics() | يعيد مدخلًا واحدًا لكل مجمّع ذاكرة في بيئة التشغيل. |
setFlagsFromString(flags) | يقبل سلسلة نصية ولا يكون له أي تأثير آخر. |
serialize(value) | يرمّز JSON.stringify(value) بصيغة UTF-8 في Uint8Array. |
deserialize(buffer) | يفك ترميز UTF-8 ويحلّل حمولة JSON. |
أسماء المجمّعات هي أسماء بيئة التشغيل مثل eden space، لا أسماء V8.
const v8 = require("node:v8");
const bytes = v8.serialize({ hello: "world" });
v8.deserialize(bytes); // { hello: "world" }للتسلسل دلالات JSON. وهو غير متوافق مع صيغة النقل
structured-clone في V8، والكائنات الدائرية ترمي TypeError.
انظر أيضًا
Reference
Status: Partial · Not measured · since 1.1.0
Exports
| Export | Kind | Status | Notes |
|---|---|---|---|
getHeapStatistics() | function | Full | Returns an object with V8 heap statistics |
getHeapSpaceStatistics() | function | Full | Returns statistics about V8 heap spaces |
setFlagsFromString() | function | Full | Set additional V8 command-line flags |
serialize() | function | Full | Serializes a value into a buffer |
deserialize() | function | Full | Reads a value written by serialize() from a buffer |
Not implemented
DefaultDeserializer, DefaultSerializer, Deserializer, GCProfiler, Serializer, getCppHeapStatistics, getHeapCodeStatistics, getHeapSnapshot, isStringOneByteRepresentation, promiseHooks, queryObjects, setHeapSnapshotNearHeapLimit, startCpuProfile, startHeapProfile, startupSnapshot, stopCoverage, takeCoverage, writeHeapSnapshot.