|
1 | | -# @kurrent/bridge |
2 | | - |
3 | | -This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon). |
4 | | - |
5 | | -## Building |
6 | | - |
7 | | -Building requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support). |
8 | | - |
9 | | -To run the build, run: |
10 | | - |
11 | | -```sh |
12 | | -$ npm run build |
13 | | -``` |
14 | | - |
15 | | -This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`. |
16 | | - |
17 | | -## Exploring |
18 | | - |
19 | | -After building, you can explore its exports at the Node console: |
20 | | - |
21 | | -```sh |
22 | | -$ npm i |
23 | | -$ npm run build |
24 | | -$ node |
25 | | -> var client = require('.').createClient("kurrentdb://admin:changeit@localhost:8080?tls=false") |
26 | | -``` |
27 | | - |
28 | | -## Available Scripts |
29 | | - |
30 | | -In the project directory, you can run: |
31 | | - |
32 | | -#### `npm run build` |
33 | | - |
34 | | -Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`. |
35 | | - |
36 | | -Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html): |
37 | | - |
38 | | -``` |
39 | | -npm run build -- --feature=beetle |
40 | | -``` |
41 | | - |
42 | | -#### `npm run debug` |
43 | | - |
44 | | -Similar to `npm run build` but generates a debug build with `cargo`. |
45 | | - |
46 | | -#### `npm run cross` |
47 | | - |
48 | | -Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target. |
49 | | - |
50 | | -#### `npm run release` |
51 | | - |
52 | | -Initiate a full build and publication of a new patch release of this library via GitHub Actions. |
53 | | - |
54 | | -#### `npm run dryrun` |
55 | | - |
56 | | -Initiate a dry run of a patch release of this library via GitHub Actions. This performs a full build but does not publish the final result. |
57 | | - |
58 | | -#### `npm test` |
59 | | - |
60 | | -Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/). |
61 | | - |
62 | | -## Project Layout |
63 | | - |
64 | | -The directory structure of this project is: |
65 | | - |
66 | | -``` |
67 | | -kurrentdb-bridge-client/ |
68 | | -├── Cargo.toml |
69 | | -├── README.md |
70 | | -├── lib/ |
71 | | -├── src/ |
72 | | -| ├── index.mts |
73 | | -| └── index.cts |
74 | | -├── crates/ |
75 | | -| └── bridge/ |
76 | | -| └── src/ |
77 | | -| └── lib.rs |
78 | | -├── platforms/ |
79 | | -├── package.json |
80 | | -└── target/ |
81 | | -``` |
82 | | - |
83 | | -| Entry | Purpose | |
84 | | -|----------------|------------------------------------------------------------------------------------------------------------------------------------------| |
85 | | -| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. | |
86 | | -| `README.md` | This file. | |
87 | | -| `lib/` | The directory containing the generated output from [tsc](https://typescriptlang.org). | |
88 | | -| `src/` | The directory containing the TypeScript source files. | |
89 | | -| `index.mts` | Entry point for when this library is loaded via [ESM `import`](https://nodejs.org/api/esm.html#modules-ecmascript-modules) syntax. | |
90 | | -| `index.cts` | Entry point for when this library is loaded via [CJS `require`](https://nodejs.org/api/modules.html#requireid). | |
91 | | -| `crates/` | The directory tree containing the Rust source code for the project. | |
92 | | -| `lib.rs` | Entry point for the Rust source code. | |
93 | | -| `platforms/` | The directory containing distributions of the binary addon backend for each platform supported by this library. | |
94 | | -| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. | |
95 | | -| `target/` | Binary artifacts generated by the Rust build. | |
96 | | - |
97 | | -## Learn More |
98 | | - |
99 | | -Learn more about: |
100 | | - |
101 | | -- [Neon](https://neon-bindings.com). |
102 | | -- [Rust](https://www.rust-lang.org). |
103 | | -- [Node](https://nodejs.org). |
| 1 | +<a href="https://kurrent.io"> |
| 2 | + <picture> |
| 3 | + <source media="(prefers-color-scheme: dark)" srcset="KurrentLogo-White.png"> |
| 4 | + <source media="(prefers-color-scheme: light)" srcset="KurrentLogo-Black.png"> |
| 5 | + <img alt="Kurrent" src="KurrentLogo-Plum.png" height="50%" width="50%"> |
| 6 | + </picture> |
| 7 | +</a> |
| 8 | + |
| 9 | +# @kurrent/bridge |
| 10 | + |
| 11 | +[](https://github.com/EventStore/EventStore-Streaming/actions/workflows/build-surge.yml) |
| 12 | + |
| 13 | + |
| 14 | +## Overview |
| 15 | + |
| 16 | +The library improves the performance of the [KurrentDB NodeJS client](https://github.com/EventStore/KurrentDB-Client-NodeJS) by |
| 17 | +integrating the Rust implementation through native addons. It uses |
| 18 | +[Neon](https://github.com/neon-bindings/neon) to create bindings and leverages |
| 19 | +Rust's high-performance characteristics within the Node.js ecosystem. |
| 20 | + |
| 21 | +## Contributing |
| 22 | + |
| 23 | +Contributions are welcome! Please read the [contribution guidelines](CONTRIBUTING.md) for more information on how to get started. |
| 24 | + |
| 25 | +## Support |
| 26 | + |
| 27 | +Information on support can be found on our website: [Kurrent Support](https://kurrent.io/support/) |
| 28 | + |
| 29 | +## Communities |
| 30 | + |
| 31 | +- [Discuss](https://discuss.kurrent.io/) |
| 32 | +- [Discord (Kurrent)](https://discord.gg/Phn9pmCw3t) |
| 33 | +- [Discord (ddd-cqrs-es)](https://discord.com/invite/sEZGSHNNbH) |
| 34 | + |
| 35 | +## Licensing |
| 36 | + |
| 37 | +View [Kurrent's licensing information](https://github.com/EventStore/kurrentdb-bridge-client/blob/master/LICENSE.md) |
0 commit comments