mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add a Node.js wrapper library
The implementation is very similar to the Python wrapper.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# libloot-nodejs
|
||||
|
||||
An **experimental** Node.js wrapper around the libloot Rust implementation, built using [NAPI-RS](https://napi.rs/docs/concepts/class).
|
||||
|
||||
## Build
|
||||
|
||||
To build, first install Rust and Node.js, then run:
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
The tests can be run using:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
## Usage notes
|
||||
|
||||
- All errors are thrown as JavaScript `Error` values. The error message is the concatenated display text of all the recursive Rust errors from the libloot crate, with the exception of `PluginDataError` errors, which are turned into messages of the form `esplugin error, code <code>: <display text>`, where `<code>` is one of the esplugin error codes currently exposed by the C++ implementation of libloot.
|
||||
Reference in New Issue
Block a user