• Home
Name Date Size #Lines LOC

..--

example/12-May-2024-9779

.eslintrcD12-May-20241 KiB5555

.gitignoreD12-May-20240

CHANGELOG.mdD12-May-202473 42

CMakeLists.txtD12-May-20243.2 KiB9683

README.mdD12-May-20241.3 KiB5940

binary.jsD12-May-20241.6 KiB376

ejdb2_node.cD12-May-202454.2 KiB2,0921,795

hints.txtD12-May-2024131 32

index.d.tsD12-May-202411.7 KiB46394

index.jsD12-May-202418.2 KiB723359

install.jsD12-May-20243.4 KiB9052

js_native_api.hD12-May-202427.9 KiB558445

js_native_api_types.hD12-May-20243.8 KiB147115

node_api.hD12-May-202411.3 KiB269213

node_api_types.hD12-May-20241.6 KiB5142

package.jsonD12-May-20241.2 KiB7170

test.jsD12-May-20246.6 KiB249161

tsconfig.jsonD12-May-2024561 2626

tslint.jsonD12-May-20241 KiB5353

utils.jsD12-May-20243.8 KiB12982

version.txtD12-May-20241

yarn.lockD12-May-202468 KiB1,5871,346

README.md

1# EJDB2 Node.js native binding
2
3Embeddable JSON Database engine http://ejdb.org Node.js binding.
4
5See https://github.com/Softmotions/ejdb/blob/master/README.md
6
7For API usage examples take a look into [/example](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_node/example) and [test.js](https://github.com/Softmotions/ejdb/tree/master/src/bindings/ejdb2_node/test.js)
8
9## Sample code
10
11```ts
12import { EJDB2 } from "ejdb2_node";
13
14async function run() {
15  const db = await EJDB2.open("example.db", { truncate: true });
16
17  var id = await db.put("parrots", { name: "Bianca", age: 4 });
18  console.log(`Bianca record: ${id}`);
19
20  id = await db.put("parrots", { name: "Darko", age: 8 });
21  console.log(`Darko record: ${id}`);
22
23  const q = db.createQuery("/[age > :age]", "parrots");
24
25  for await (const doc of q.setNumber("age", 3).stream()) {
26    console.log(`Found ${doc}`);
27  }
28
29  await db.close();
30}
31
32run();
33```
34
35## Supported platforms
36
37- Linux x64
38- OSX
39
40## Prerequisites
41
42- node >= v10.0.0
43- yarn
44- CMake >= v3.10
45- Make
46- gcc or clang compiler
47
48## How build it manually
49
50```sh
51git clone https://github.com/Softmotions/ejdb.git
52cd ./ejdb
53mkdir ./build && cd build
54cmake .. -DBUILD_NODEJS_BINDING=ON -DCMAKE_BUILD_TYPE=Release
55make
56cd src/bindings/ejdb2_node/ejdb2_node
57yarn pack
58```
59