- switch to napi-rs. this mostly affects only the backend side of things, but IMO napi-rs is better (also, way less boilerplate is needed compared to neon). - jpeg encoding no longer clones the input buffer internally (or wraps it in a Mutex as well), thanks to napi-rs not sucking in this regard. this is *probably* a micro-optimization, but will make it easier to later on do parallel encoding of all rectangles - guac encoding is weird. This is kind of a painpoint of napi-rs but it's bearable
13 lines
353 B
JavaScript
13 lines
353 B
JavaScript
// *sigh*
|
|
import { createRequire } from 'module';
|
|
const require = createRequire(import.meta.url);
|
|
|
|
let {guacDecode, guacEncodeImpl, jpegEncode} = require('./index.node');
|
|
|
|
export { guacDecode, jpegEncode };
|
|
|
|
// shim for js->rust interop, because napi-rs kind of blows in this regard
|
|
export function guacEncode(...args) {
|
|
return guacEncodeImpl(args);
|
|
}
|