Skip to content

Conversation

@thibmeu
Copy link
Owner

@thibmeu thibmeu commented Jul 4, 2023

Wrap tlock_age methods with wasm-bindgen to allow for a use in JavaScript and TypeScript. This is done through an optional feature js.
Armoring is supported.

Methods use a Uint8Array containing the full source to encrypt or decrypt. Result is returned as Uint8Array.

Two targets have been tested

  • NodeJS wasm-pack build --target nodejs -- --features js. Then const tlock_age = require('./pkg')
  • Web wasm-pack build --target web -- --features js. You can then point your bundler to use ./pkg. Don't forget to call the default export init() to load the module in browser.

TODO

  • Add JS use examples
  • Add wasm-build documentation
  • Add lib_js.rs code comment
  • Add tests for JS methods

Wrap `tlock_age` methods with wasm-bindgen to allow for a use in JavaScript and TypeScript.
This is done through an optional feature `js`.
Armoring is supported.

Methods use a Uint8Array containing the full source to encrypt or decrypt. Result is returned as Uint8Array.

Two targets have been tested
- NodeJS `wasm-pack build --target nodejs -- --features js`. Then `const tlock_age = require('./pkg')`
- Web `wasm-pack build --target web -- --features js`. You can then point your bundler to use `./pkg`. Don't forget to call the default export `init()` to load the module in browser.
@thibmeu thibmeu added the enhancement New feature or request label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants