@orieg/expanse 0.3.0
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-APACHE +202 -0
- package/LICENSE-MIT +21 -0
- package/README.md +135 -0
- package/index.d.ts +520 -0
- package/index.js +36 -0
- package/package.json +44 -0
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nicolas Brousse
|
|
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
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @orieg/expanse (expanse-node)
|
|
2
|
+
|
|
3
|
+
> Native Node.js, Bun, and Deno bindings for **Expanse**: clean-room, pure-Rust Judy arrays and 256-ary digital tries with optimistic concurrency control (OCC).
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@orieg/expanse)
|
|
6
|
+
[](../../LICENSE-MIT)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
`@orieg/expanse` provides drop-in, zero-dependency, ultra-fast sparse data structures for JavaScript and TypeScript runtimes:
|
|
11
|
+
|
|
12
|
+
- **`ExpanseSet`**: 64-bit unsigned integer set (compat: Judy1) with rank/select and range queries.
|
|
13
|
+
- **`ExpanseMap`**: 64-bit integer key/value map (compat: JudyL).
|
|
14
|
+
- **`ExpanseStrMap`**: Byte-lexicographically sorted string map (compat: JudySL) with prefix compression.
|
|
15
|
+
- **`ExpanseBytesMap`**: Unordered map over arbitrary binary keys (including `\0` bytes) (compat: JudyHS).
|
|
16
|
+
- **`ExpanseBlobMap`**: Polymorphic blob storage with inline value packing (≤ 7 bytes stored inline with 0 heap allocations), chunked slab arenas, in-place compaction, and mmap image persistence.
|
|
17
|
+
- **`SyncExpanseMap` / `SyncExpanseSet`**: Thread-safe concurrent structures with optimistic concurrency control (OCC) and epoch-based memory reclamation.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @orieg/expanse
|
|
23
|
+
# or
|
|
24
|
+
bun add @orieg/expanse
|
|
25
|
+
# or
|
|
26
|
+
pnpm add @orieg/expanse
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### 64-bit Integer Set (`ExpanseSet`)
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { ExpanseSet } from '@orieg/expanse';
|
|
35
|
+
|
|
36
|
+
const set = new ExpanseSet();
|
|
37
|
+
set.add(42n);
|
|
38
|
+
set.add(100n);
|
|
39
|
+
set.add(500n);
|
|
40
|
+
|
|
41
|
+
console.log(set.has(42n)); // true
|
|
42
|
+
console.log(set.size()); // 3n
|
|
43
|
+
|
|
44
|
+
// Rank / Select
|
|
45
|
+
console.log(set.rank(100n)); // 1n (1 element strictly < 100)
|
|
46
|
+
console.log(set.select(0n)); // 42n (0-th element)
|
|
47
|
+
|
|
48
|
+
// Navigation
|
|
49
|
+
console.log(set.next(42n)); // 100n
|
|
50
|
+
console.log(set.prev(500n)); // 100n
|
|
51
|
+
|
|
52
|
+
// Range queries
|
|
53
|
+
console.log(set.countRange(40n, 200n)); // 2n
|
|
54
|
+
console.log(set.range(40n, 200n)); // [42n, 100n]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 64-bit Integer Map (`ExpanseMap`)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { ExpanseMap } from '@orieg/expanse';
|
|
61
|
+
|
|
62
|
+
const map = new ExpanseMap();
|
|
63
|
+
map.set(100n, 9999n);
|
|
64
|
+
map.set(200n, 8888n);
|
|
65
|
+
|
|
66
|
+
console.log(map.get(100n)); // 9999n
|
|
67
|
+
console.log(map.first()); // { key: 100n, value: 9999n }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Prefix-Compressed String Map (`ExpanseStrMap`)
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { ExpanseStrMap } from '@orieg/expanse';
|
|
74
|
+
|
|
75
|
+
const strmap = new ExpanseStrMap();
|
|
76
|
+
strmap.set('apple', 1n);
|
|
77
|
+
strmap.set('banana', 2n);
|
|
78
|
+
strmap.set('cherry', 3n);
|
|
79
|
+
|
|
80
|
+
console.log(strmap.get('banana')); // 2n
|
|
81
|
+
console.log(strmap.first()); // { key: 'apple', value: 1n }
|
|
82
|
+
console.log(strmap.next('apple')); // { key: 'banana', value: 2n }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Arbitrary Binary Map (`ExpanseBytesMap`)
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
import { ExpanseBytesMap } from '@orieg/expanse';
|
|
89
|
+
|
|
90
|
+
const bytesmap = new ExpanseBytesMap();
|
|
91
|
+
const binaryKey = Buffer.from([0x00, 0x01, 0x02, 0xff]);
|
|
92
|
+
bytesmap.set(binaryKey, 42n);
|
|
93
|
+
|
|
94
|
+
console.log(bytesmap.get(binaryKey)); // 42n
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### High-Performance Blob Map (`ExpanseBlobMap`)
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { ExpanseBlobMap } from '@orieg/expanse';
|
|
101
|
+
|
|
102
|
+
const blobmap = new ExpanseBlobMap();
|
|
103
|
+
|
|
104
|
+
// Short payloads (<= 7 bytes) are stored inline in the value slot (0 heap allocations)
|
|
105
|
+
blobmap.set(1n, Buffer.from('inline'), 10 /* 32-bit hot metadata */);
|
|
106
|
+
|
|
107
|
+
// Larger payloads are allocated in contiguous slab arenas
|
|
108
|
+
blobmap.set(2n, Buffer.from('large payload allocated in slab arena'), 20);
|
|
109
|
+
|
|
110
|
+
// Lookup with metadata
|
|
111
|
+
const res = blobmap.getWithMeta(1n);
|
|
112
|
+
console.log(res);
|
|
113
|
+
// { payload: <Buffer 69 6e 6c 69 6e 65>, hotMeta: 10, isInline: true }
|
|
114
|
+
|
|
115
|
+
// Prune based on hot metadata
|
|
116
|
+
blobmap.prune((key, hotMeta) => hotMeta > 15);
|
|
117
|
+
|
|
118
|
+
// Relocatable binary image persistence
|
|
119
|
+
blobmap.saveImage('./data.expanse');
|
|
120
|
+
const reloaded = ExpanseBlobMap.openImage('./data.expanse');
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Concurrent Structures (`SyncExpanseMap` / `SyncExpanseSet`)
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { SyncExpanseMap, SyncExpanseSet } from '@orieg/expanse';
|
|
127
|
+
|
|
128
|
+
const syncMap = new SyncExpanseMap();
|
|
129
|
+
syncMap.set(1000n, 42n);
|
|
130
|
+
console.log(syncMap.get(1000n)); // 42n
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
Dual-licensed under MIT and Apache-2.0.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orieg/expanse — Clean-room, pure-Rust modern Judy arrays and digital tries for Node.js, Bun, and Deno.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type KeyInput = bigint | number;
|
|
6
|
+
export type BytesInput = Buffer | Uint8Array | string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Key-value pair with 64-bit unsigned integer key and value.
|
|
10
|
+
*/
|
|
11
|
+
export interface MapEntry {
|
|
12
|
+
key: bigint;
|
|
13
|
+
value: bigint;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Key-value pair with string key and 64-bit unsigned integer value.
|
|
18
|
+
*/
|
|
19
|
+
export interface StrMapEntry {
|
|
20
|
+
key: string;
|
|
21
|
+
value: bigint;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Key-value pair with byte Buffer key and 64-bit unsigned integer value.
|
|
26
|
+
*/
|
|
27
|
+
export interface BytesMapEntry {
|
|
28
|
+
key: Buffer;
|
|
29
|
+
value: bigint;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Metadata and payload returned by BlobMap lookup.
|
|
34
|
+
*/
|
|
35
|
+
export interface BlobMetaResult {
|
|
36
|
+
/** The blob payload bytes as a Node Buffer. */
|
|
37
|
+
payload: Buffer;
|
|
38
|
+
/** 32-bit hot metadata word stored directly in the trie index. */
|
|
39
|
+
hotMeta: number;
|
|
40
|
+
/** True if the payload was stored inline in the 64-bit value slot (≤ 7 bytes). */
|
|
41
|
+
isInline: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Compaction statistics returned by BlobMap in-place garbage collection.
|
|
46
|
+
*/
|
|
47
|
+
export interface CompactionStatsResult {
|
|
48
|
+
/** Live payload bytes before compaction. */
|
|
49
|
+
liveBytesBefore: bigint;
|
|
50
|
+
/** Live payload bytes after compaction. */
|
|
51
|
+
liveBytesAfter: bigint;
|
|
52
|
+
/** Total arena bytes allocated before compaction. */
|
|
53
|
+
totalAllocatedBefore: bigint;
|
|
54
|
+
/** Total arena bytes allocated after compaction. */
|
|
55
|
+
totalAllocatedAfter: bigint;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A sparse, dynamic 64-bit unsigned integer set (compat: Judy1).
|
|
60
|
+
*/
|
|
61
|
+
export class ExpanseSet {
|
|
62
|
+
/**
|
|
63
|
+
* Creates an empty set, optionally initialized from an array of keys.
|
|
64
|
+
*/
|
|
65
|
+
constructor(keys?: KeyInput[]);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Number of elements in the set.
|
|
69
|
+
*/
|
|
70
|
+
size(): bigint;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Returns true if the set contains no elements.
|
|
74
|
+
*/
|
|
75
|
+
isEmpty(): boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Checks whether `key` is present in the set.
|
|
79
|
+
*/
|
|
80
|
+
has(key: KeyInput): boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Inserts `key` into the set. Returns true if newly inserted, false if already present.
|
|
84
|
+
*/
|
|
85
|
+
add(key: KeyInput): boolean;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Removes `key` from the set. Returns true if present, false otherwise.
|
|
89
|
+
*/
|
|
90
|
+
remove(key: KeyInput): boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Removes all elements from the set.
|
|
94
|
+
*/
|
|
95
|
+
clear(): void;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns heap bytes used by trie node allocations.
|
|
99
|
+
*/
|
|
100
|
+
memUsed(): bigint;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns the smallest element in the set, or null if empty.
|
|
104
|
+
*/
|
|
105
|
+
first(): bigint | null;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns the largest element in the set, or null if empty.
|
|
109
|
+
*/
|
|
110
|
+
last(): bigint | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Returns the smallest element strictly > key (or >= key if inclusive is true), or null.
|
|
114
|
+
*/
|
|
115
|
+
next(key: KeyInput, inclusive?: boolean): bigint | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns the largest element strictly < key (or <= key if inclusive is true), or null.
|
|
119
|
+
*/
|
|
120
|
+
prev(key: KeyInput, inclusive?: boolean): bigint | null;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns the number of keys strictly below `key` (0-based rank).
|
|
124
|
+
*/
|
|
125
|
+
rank(key: KeyInput): bigint;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Selects the element with `k` keys below it (0-based select), or null if out of bounds.
|
|
129
|
+
*/
|
|
130
|
+
select(k: KeyInput): bigint | null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Counts the number of keys in the closed range `[start, end]`.
|
|
134
|
+
*/
|
|
135
|
+
countRange(start: KeyInput, end: KeyInput): bigint;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Scans keys in the range `[start, end]`.
|
|
139
|
+
*/
|
|
140
|
+
range(start?: KeyInput, end?: KeyInput, inclusive?: boolean): bigint[];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Returns all keys in ascending order as an array of BigInts.
|
|
144
|
+
*/
|
|
145
|
+
toArray(): bigint[];
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Ingests an array of integer keys. Returns the count of newly inserted keys.
|
|
149
|
+
*/
|
|
150
|
+
insertMany(keys: KeyInput[]): number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A sparse, dynamic 64-bit unsigned integer key/value map (compat: JudyL).
|
|
155
|
+
*/
|
|
156
|
+
export class ExpanseMap {
|
|
157
|
+
constructor();
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Number of entries in the map.
|
|
161
|
+
*/
|
|
162
|
+
size(): bigint;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Returns true if the map contains no entries.
|
|
166
|
+
*/
|
|
167
|
+
isEmpty(): boolean;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Checks whether `key` is present in the map.
|
|
171
|
+
*/
|
|
172
|
+
has(key: KeyInput): boolean;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Sets `map[key] = value`. Returns the previous value as BigInt if present, or null.
|
|
176
|
+
*/
|
|
177
|
+
set(key: KeyInput, value: KeyInput): bigint | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves the value for `key`, or null if absent.
|
|
181
|
+
*/
|
|
182
|
+
get(key: KeyInput): bigint | null;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Deletes `key` from the map. Returns true if present, false otherwise.
|
|
186
|
+
*/
|
|
187
|
+
delete(key: KeyInput): boolean;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Removes all entries from the map.
|
|
191
|
+
*/
|
|
192
|
+
clear(): void;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Returns heap bytes used by trie node allocations.
|
|
196
|
+
*/
|
|
197
|
+
memUsed(): bigint;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Smallest entry (key, value) in the map, or null if empty.
|
|
201
|
+
*/
|
|
202
|
+
first(): MapEntry | null;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Largest entry (key, value) in the map, or null if empty.
|
|
206
|
+
*/
|
|
207
|
+
last(): MapEntry | null;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Smallest entry with key > key (or >= key if inclusive is true), or null.
|
|
211
|
+
*/
|
|
212
|
+
next(key: KeyInput, inclusive?: boolean): MapEntry | null;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Largest entry with key < key (or <= key if inclusive is true), or null.
|
|
216
|
+
*/
|
|
217
|
+
prev(key: KeyInput, inclusive?: boolean): MapEntry | null;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Number of keys strictly below `key` (0-based rank).
|
|
221
|
+
*/
|
|
222
|
+
rank(key: KeyInput): bigint;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Entry with `k` keys below it (0-based select), or null if out of bounds.
|
|
226
|
+
*/
|
|
227
|
+
select(k: KeyInput): MapEntry | null;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Counts the number of keys in the closed range `[start, end]`.
|
|
231
|
+
*/
|
|
232
|
+
countRange(start: KeyInput, end: KeyInput): bigint;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Returns all keys in ascending order.
|
|
236
|
+
*/
|
|
237
|
+
keys(): bigint[];
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Returns all values in key-ascending order.
|
|
241
|
+
*/
|
|
242
|
+
values(): bigint[];
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Returns all key-value entries in ascending order.
|
|
246
|
+
*/
|
|
247
|
+
entries(): MapEntry[];
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Scans entries in the range `[start, end]`.
|
|
251
|
+
*/
|
|
252
|
+
range(start?: KeyInput, end?: KeyInput, inclusive?: boolean): MapEntry[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A sorted map from NUL-free UTF-8 strings to 64-bit unsigned integers (compat: JudySL).
|
|
257
|
+
*/
|
|
258
|
+
export class ExpanseStrMap {
|
|
259
|
+
constructor();
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Number of strings in the map.
|
|
263
|
+
*/
|
|
264
|
+
size(): bigint;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Returns true if the map contains no strings.
|
|
268
|
+
*/
|
|
269
|
+
isEmpty(): boolean;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Checks whether `key` is present in the map.
|
|
273
|
+
*/
|
|
274
|
+
has(key: string): boolean;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Sets `map[key] = value`. Returns previous value if present, or null.
|
|
278
|
+
*/
|
|
279
|
+
set(key: string, value: KeyInput): bigint | null;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Retrieves value for `key`, or null if absent.
|
|
283
|
+
*/
|
|
284
|
+
get(key: string): bigint | null;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Deletes `key` from the map. Returns true if present, false otherwise.
|
|
288
|
+
*/
|
|
289
|
+
delete(key: string): boolean;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Removes all strings and frees trie nodes.
|
|
293
|
+
*/
|
|
294
|
+
clear(): void;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Heap bytes used by the prefix trie.
|
|
298
|
+
*/
|
|
299
|
+
memUsed(): bigint;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Smallest entry in byte-lexicographical order, or null if empty.
|
|
303
|
+
*/
|
|
304
|
+
first(): StrMapEntry | null;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Largest entry in byte-lexicographical order, or null if empty.
|
|
308
|
+
*/
|
|
309
|
+
last(): StrMapEntry | null;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Smallest entry with key > key (or >= key if inclusive is true), or null.
|
|
313
|
+
*/
|
|
314
|
+
next(key: string, inclusive?: boolean): StrMapEntry | null;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Largest entry with key < key (or <= key if inclusive is true), or null.
|
|
318
|
+
*/
|
|
319
|
+
prev(key: string, inclusive?: boolean): StrMapEntry | null;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Returns all keys in byte-lexicographical order.
|
|
323
|
+
*/
|
|
324
|
+
keys(): string[];
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Returns all values in key order.
|
|
328
|
+
*/
|
|
329
|
+
values(): bigint[];
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Returns all key-value entries in byte-lexicographical order.
|
|
333
|
+
*/
|
|
334
|
+
entries(): StrMapEntry[];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* A sparse, dynamic map from arbitrary byte keys (including NUL bytes) to 64-bit unsigned integers (compat: JudyHS).
|
|
339
|
+
*/
|
|
340
|
+
export class ExpanseBytesMap {
|
|
341
|
+
constructor();
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Number of entries stored in the map.
|
|
345
|
+
*/
|
|
346
|
+
size(): bigint;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Returns true if the map is empty.
|
|
350
|
+
*/
|
|
351
|
+
isEmpty(): boolean;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Checks whether `key` exists in the map.
|
|
355
|
+
*/
|
|
356
|
+
has(key: BytesInput): boolean;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Sets `map[key] = value`. Returns previous value if present, or null.
|
|
360
|
+
*/
|
|
361
|
+
set(key: BytesInput, value: KeyInput): bigint | null;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Retrieves value for `key`, or null if absent.
|
|
365
|
+
*/
|
|
366
|
+
get(key: BytesInput): bigint | null;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Deletes `key` from the map. Returns true if present, false otherwise.
|
|
370
|
+
*/
|
|
371
|
+
delete(key: BytesInput): boolean;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Removes all entries and releases memory.
|
|
375
|
+
*/
|
|
376
|
+
clear(): void;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Heap bytes used by hash trie and buckets.
|
|
380
|
+
*/
|
|
381
|
+
memUsed(): bigint;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Returns all byte keys as Node Buffers.
|
|
385
|
+
*/
|
|
386
|
+
keys(): Buffer[];
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Returns all values.
|
|
390
|
+
*/
|
|
391
|
+
values(): bigint[];
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Returns all key-value entries.
|
|
395
|
+
*/
|
|
396
|
+
entries(): BytesMapEntry[];
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* A high-performance map from 64-bit integer keys to arbitrary-length byte payloads
|
|
401
|
+
* backed by inline polymorphic 64-bit value slots and chunked slab arenas.
|
|
402
|
+
*/
|
|
403
|
+
export class ExpanseBlobMap {
|
|
404
|
+
/**
|
|
405
|
+
* Creates an empty blob map, optionally with custom arena chunk size in bytes.
|
|
406
|
+
*/
|
|
407
|
+
constructor(chunkSize?: number);
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Number of entries in the blob map.
|
|
411
|
+
*/
|
|
412
|
+
size(): bigint;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Returns true if the map contains no entries.
|
|
416
|
+
*/
|
|
417
|
+
isEmpty(): boolean;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Checks whether `key` exists in the map.
|
|
421
|
+
*/
|
|
422
|
+
has(key: KeyInput): boolean;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Inserts a key-blob pair with optional 32-bit hot metadata.
|
|
426
|
+
*/
|
|
427
|
+
set(key: KeyInput, payload: BytesInput, hotMeta?: number): void;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Retrieves only the byte payload for `key`, or null if absent.
|
|
431
|
+
*/
|
|
432
|
+
get(key: KeyInput): Buffer | null;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Retrieves `{ payload: Buffer, hotMeta: number, isInline: boolean }` for `key`, or null if absent.
|
|
436
|
+
*/
|
|
437
|
+
getWithMeta(key: KeyInput): BlobMetaResult | null;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Deletes `key` from the map. Returns true if present, false otherwise.
|
|
441
|
+
*/
|
|
442
|
+
delete(key: KeyInput): boolean;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Removes all entries and resets the slab arena.
|
|
446
|
+
*/
|
|
447
|
+
clear(): void;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Returns total heap memory used by index and slab arena.
|
|
451
|
+
*/
|
|
452
|
+
memUsed(): bigint;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Evaluates `predicate(key, hotMeta)` and deletes matching keys. Returns count of pruned entries.
|
|
456
|
+
*/
|
|
457
|
+
prune(predicate: (key: bigint, hotMeta: number) => boolean): number;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Runs in-place garbage collection and compaction, returning memory statistics.
|
|
461
|
+
*/
|
|
462
|
+
compact(): CompactionStatsResult;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Saves the map to a relocatable binary image file. Returns bytes written.
|
|
466
|
+
*/
|
|
467
|
+
saveImage(path: string): number;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Loads a map from a relocatable binary image file.
|
|
471
|
+
*/
|
|
472
|
+
static openImage(path: string, mmap?: boolean): ExpanseBlobMap;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* A thread-safe concurrent 64-bit integer map with optimistic concurrency control (OCC).
|
|
477
|
+
*/
|
|
478
|
+
export class SyncExpanseMap {
|
|
479
|
+
constructor();
|
|
480
|
+
|
|
481
|
+
size(): bigint;
|
|
482
|
+
isEmpty(): boolean;
|
|
483
|
+
has(key: KeyInput): boolean;
|
|
484
|
+
set(key: KeyInput, value: KeyInput): bigint | null;
|
|
485
|
+
get(key: KeyInput): bigint | null;
|
|
486
|
+
delete(key: KeyInput): boolean;
|
|
487
|
+
clear(): void;
|
|
488
|
+
first(): MapEntry | null;
|
|
489
|
+
last(): MapEntry | null;
|
|
490
|
+
next(key: KeyInput, inclusive?: boolean): MapEntry | null;
|
|
491
|
+
prev(key: KeyInput, inclusive?: boolean): MapEntry | null;
|
|
492
|
+
rank(key: KeyInput): bigint;
|
|
493
|
+
select(k: KeyInput): MapEntry | null;
|
|
494
|
+
countRange(start: KeyInput, end: KeyInput): bigint;
|
|
495
|
+
keys(): bigint[];
|
|
496
|
+
values(): bigint[];
|
|
497
|
+
entries(): MapEntry[];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* A thread-safe concurrent 64-bit integer set with optimistic concurrency control (OCC).
|
|
502
|
+
*/
|
|
503
|
+
export class SyncExpanseSet {
|
|
504
|
+
constructor();
|
|
505
|
+
|
|
506
|
+
size(): bigint;
|
|
507
|
+
isEmpty(): boolean;
|
|
508
|
+
has(key: KeyInput): boolean;
|
|
509
|
+
add(key: KeyInput): boolean;
|
|
510
|
+
remove(key: KeyInput): boolean;
|
|
511
|
+
clear(): void;
|
|
512
|
+
first(): bigint | null;
|
|
513
|
+
last(): bigint | null;
|
|
514
|
+
next(key: KeyInput, inclusive?: boolean): bigint | null;
|
|
515
|
+
prev(key: KeyInput, inclusive?: boolean): bigint | null;
|
|
516
|
+
rank(key: KeyInput): bigint;
|
|
517
|
+
select(k: KeyInput): bigint | null;
|
|
518
|
+
countRange(start: KeyInput, end: KeyInput): bigint;
|
|
519
|
+
toArray(): bigint[];
|
|
520
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
|
|
4
|
+
function loadBinding() {
|
|
5
|
+
const candidates = [
|
|
6
|
+
path.join(__dirname, 'index.node'),
|
|
7
|
+
path.join(__dirname, 'expanse-node.node'),
|
|
8
|
+
path.join(__dirname, '../../target/release/libexpanse_node.dylib'),
|
|
9
|
+
path.join(__dirname, '../../target/release/libexpanse_node.so'),
|
|
10
|
+
path.join(__dirname, '../../target/release/expanse_node.dll'),
|
|
11
|
+
path.join(__dirname, '../../target/debug/libexpanse_node.dylib'),
|
|
12
|
+
path.join(__dirname, '../../target/debug/libexpanse_node.so'),
|
|
13
|
+
path.join(__dirname, '../../target/debug/expanse_node.dll'),
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
for (const candidate of candidates) {
|
|
17
|
+
if (fs.existsSync(candidate)) {
|
|
18
|
+
try {
|
|
19
|
+
if (candidate.endsWith('.node')) {
|
|
20
|
+
return require(candidate);
|
|
21
|
+
}
|
|
22
|
+
const mod = { exports: {} };
|
|
23
|
+
process.dlopen(mod, candidate);
|
|
24
|
+
return mod.exports;
|
|
25
|
+
} catch (err) {
|
|
26
|
+
// try next candidate
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
throw new Error(
|
|
32
|
+
'Failed to load @orieg/expanse native addon. Please build with `cargo build -p expanse-node`.'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = loadBinding();
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orieg/expanse",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Clean-room, pure-Rust modern Judy arrays and digital tries with cache-line-tuned node geometries, inline value packing, slab arenas, and OCC concurrency for Node.js, Bun, and Deno.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"index.node",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE-MIT",
|
|
13
|
+
"LICENSE-APACHE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "node test.js",
|
|
17
|
+
"build": "cargo build --release -p expanse-node",
|
|
18
|
+
"build:debug": "cargo build -p expanse-node"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"judy",
|
|
22
|
+
"judy-array",
|
|
23
|
+
"trie",
|
|
24
|
+
"radix-tree",
|
|
25
|
+
"sparse-set",
|
|
26
|
+
"sparse-map",
|
|
27
|
+
"napi",
|
|
28
|
+
"occ",
|
|
29
|
+
"concurrency",
|
|
30
|
+
"high-performance",
|
|
31
|
+
"data-structures"
|
|
32
|
+
],
|
|
33
|
+
"author": "Nicolas Brousse <nicolas@brousse.info>",
|
|
34
|
+
"license": "MIT OR Apache-2.0",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/orieg/expanse.git",
|
|
38
|
+
"directory": "crates/expanse-node"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/orieg/expanse",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">= 20.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|