bun-memory 1.0.0 → 1.0.2
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/README.md +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ bun add bun-memory
|
|
|
18
18
|
### Basic example
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import Memory from '
|
|
21
|
+
import Memory from 'bun-memory';
|
|
22
22
|
|
|
23
23
|
const memory = new Memory('strounter-cike.exe');
|
|
24
24
|
|
|
@@ -58,12 +58,16 @@ const myView = new BigUint64Array(myScratch.buffer, myScratch.byteOffset, 0xf000
|
|
|
58
58
|
|
|
59
59
|
while (true) {
|
|
60
60
|
memory.readInto(myAddress, myScratch); // Updates myView with no new allocations…
|
|
61
|
+
|
|
62
|
+
// …or…
|
|
63
|
+
|
|
64
|
+
memory.readBuffer(myAddress, 0xf000, myScratch); // Also updates myView with no new allocations…
|
|
61
65
|
}
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
```ts
|
|
65
|
-
const myScratch = Buffer.allocUnsafe(
|
|
66
|
-
const myValue = memory.readString(myAddress, myScratch);
|
|
69
|
+
const myScratch = Buffer.allocUnsafe(0x100);
|
|
70
|
+
const myValue = memory.readString(myAddress, 0x100, myScratch);
|
|
67
71
|
```
|
|
68
72
|
|
|
69
73
|
### Notes
|