memlab 1.1.22 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Meta Platforms, Inc. and affiliates.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -162,7 +162,7 @@ to take a heap snapshot of its own state, and write advanced memory assertions:
162
162
  ```typescript
163
163
  // save as example.test.ts
164
164
  import type {IHeapSnapshot, Nullable} from '@memlab/core';
165
- import {config, getNodeInnocentHeap} from '@memlab/core';
165
+ import {config, takeNodeMinimalHeap} from '@memlab/core';
166
166
 
167
167
  class TestObject {
168
168
  public arr1 = [1, 2, 3];
@@ -174,7 +174,7 @@ test('memory test with heap assertion', async () => {
174
174
 
175
175
  let obj: Nullable<TestObject> = new TestObject();
176
176
  // get a heap snapshot of the current program state
177
- let heap: IHeapSnapshot = await getNodeInnocentHeap();
177
+ let heap: IHeapSnapshot = await takeNodeMinimalHeap();
178
178
 
179
179
  // call some function that may add references to obj
180
180
  rabbitHole(obj)
@@ -182,7 +182,7 @@ test('memory test with heap assertion', async () => {
182
182
  expect(heap.hasObjectWithClassName('TestObject')).toBe(true);
183
183
  obj = null;
184
184
 
185
- heap = await getNodeInnocentHeap();
185
+ heap = await takeNodeMinimalHeap();
186
186
  // if rabbitHole does not have any side effect that
187
187
  // adds new references to obj, then obj can be GCed
188
188
  expect(heap.hasObjectWithClassName('TestObject')).toBe(false);
package/bin/memlab CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node --expose-gc --max-old-space-size=4096
1
+ #!/usr/bin/env -S node --expose-gc --max-old-space-size=4096
2
2
 
3
3
  /**
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "memlab",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "license": "MIT",
5
5
  "description": "memlab is a framework that analyzes memory and finds memory leaks in JavaScript applications.",
6
6
  "main": "dist/index.js",
7
7
  "files": [
8
8
  "dist",
9
- "bin"
9
+ "bin",
10
+ "LICENSE"
10
11
  ],
11
12
  "bin": {
12
13
  "memlab": "bin/memlab"