Skip to content

Commit 83ee1c3

Browse files
committed
Update readme
1 parent 2601e53 commit 83ee1c3

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# node-oom-heapdump
22
Node module which will create a V8 heap snapshot right before an "Out of Memory" error occurs.
3+
34
It can also create heapdumps and CPU profiles on request like 'v8-profiler', but does this off-process so it doesn't interfere with execution of the main process.
45

56
Tested on Node.js 8.x, but should also work fine using Node.js 6.3 upwards (According to: https://chromedevtools.github.io/devtools-protocol/v8/).
@@ -55,6 +56,7 @@ These might impact performance though.
5556

5657
# API
5758
Besides creating heapdumps when an out of memory error occurs, there also is an API for creating heapdumps and CPU profiles on request. See below for the currently available API.
59+
5860
Notice that you cannot create a heapdump while a CPU profile is being generated and vice versa; an Error will be thrown if this is the case.
5961

6062
```javascript
@@ -63,10 +65,10 @@ let nodeOomHeapdump = require("node-oom-heapdump")({
6365
});
6466

6567
/**
66-
* Returns the path to the created heap snapshot in a promise, or rejects on error
67-
* @param {String} snapshotPath - path of the snapshot
68-
* @return {Promise} Promise containing the heap snapshot path on success or error on rejection
69-
*/
68+
* Returns the path to the created heap snapshot in a promise, or rejects on error
69+
* @param {String} snapshotPath - path of the snapshot
70+
* @return {Promise} Promise containing the heap snapshot path on success or error on rejection
71+
*/
7072
nodeOomHeapdump.createHeapSnapshot("myheapsnapshotpath").then((snapshotPath) => {
7173
// do something with heap snapshot
7274

@@ -77,15 +79,15 @@ nodeOomHeapdump.createHeapSnapshot("myheapsnapshotpath").then((snapshotPath) =>
7779
});
7880

7981
/**
80-
* Deletes all previously created heapsnapshots from disk
81-
*/
82+
* Deletes all previously created heapsnapshots from disk
83+
*/
8284
nodeOomHeapdump.deleteAllHeapSnapshots();
8385

8486
/**
85-
* Deletes a particular snapshot from disk
86-
* @param {String} snapshotPath - path of the heap snapshot to delete
87-
* @return {Promise}
88-
*/
87+
* Deletes a particular snapshot from disk
88+
* @param {String} snapshotPath - path of the heap snapshot to delete
89+
* @return {Promise}
90+
*/
8991
nodeOomHeapdump.deleteHeapSnapshot(snapshotPath);
9092

9193
/**

0 commit comments

Comments
 (0)