hookshot/src/libRs.js
Will Hunt e6dd83ac5b
Support napi v2 (#111)
* Export a sensible user agent

* Completely rewrite rust portions to be napi v2 compatible

* Format rust files

* Only lint TS files when running lint-node

* Don't include autogenerated typings in the tree

* changelog

* Autofix generated rust dependencies due to a bug in napi@2

* Fix for multiple runs

* Fix format_util file name

* Make script generic

* lint
2022-01-02 01:54:57 +00:00

8 lines
253 B
JavaScript

try {
// In production, we expect it co-located
module.exports = require('./matrix-hookshot-rs.node');
} catch (ex) {
// When running under ts-node, it may not be co-located.
module.exports = require('../lib/matrix-hookshot-rs.node');
}