@knuth/js-wasm 2.10.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE.md +23 -0
  2. package/README.md +235 -22
  3. package/package.json +12 -7
  4. package/src/kth.js +6 -3
  5. package/src/kth.wasm +0 -0
  6. package/types/Bitcoin.d.ts +4 -0
  7. package/types/DerivationPath.d.ts +8 -0
  8. package/types/DoubleList.d.ts +5 -4
  9. package/types/EcCompressed.d.ts +8 -3
  10. package/types/EcPublic.d.ts +10 -4
  11. package/types/ElectrumClient.d.ts +79 -0
  12. package/types/EllipticCurve.d.ts +8 -2
  13. package/types/Hash.d.ts +5 -0
  14. package/types/HdPublic.d.ts +9 -3
  15. package/types/Input.d.ts +10 -7
  16. package/types/InputList.d.ts +6 -5
  17. package/types/Interpreter.d.ts +9 -1
  18. package/types/Kth.d.ts +4 -0
  19. package/types/LazySequence.d.ts +4 -0
  20. package/types/ListHelper.d.ts +12 -0
  21. package/types/ListNative.d.ts +4 -0
  22. package/types/NativeLifetime.d.ts +11 -0
  23. package/types/Opcode.d.ts +10 -3
  24. package/types/OpcodeAliases.d.ts +16 -0
  25. package/types/Operation.d.ts +31 -26
  26. package/types/OperationList.d.ts +6 -5
  27. package/types/Output.d.ts +11 -7
  28. package/types/OutputList.d.ts +6 -5
  29. package/types/OutputPoint.d.ts +8 -4
  30. package/types/PaymentAddress.d.ts +13 -8
  31. package/types/PaymentAddressList.d.ts +6 -5
  32. package/types/Program.d.ts +15 -2
  33. package/types/RuleFork.d.ts +4 -0
  34. package/types/Script.d.ts +34 -19
  35. package/types/ScriptFlags.d.ts +67 -0
  36. package/types/Secret.d.ts +4 -0
  37. package/types/SecretFunctions.d.ts +4 -0
  38. package/types/SighashAlgorithm.d.ts +4 -0
  39. package/types/SighashGuard.d.ts +10 -0
  40. package/types/StringList.d.ts +5 -4
  41. package/types/TokenData.d.ts +8 -3
  42. package/types/TokenDataBothKinds.d.ts +6 -3
  43. package/types/TokenDataFungible.d.ts +4 -0
  44. package/types/TokenDataNonFungible.d.ts +9 -2
  45. package/types/Transaction.d.ts +12 -10
  46. package/types/TransactionHelpers.d.ts +14 -0
  47. package/types/U32List.d.ts +5 -4
  48. package/types/U64List.d.ts +5 -4
  49. package/types/Utxo.d.ts +10 -6
  50. package/types/UtxoList.d.ts +6 -5
  51. package/types/Wallet.d.ts +28 -52
  52. package/types/WalletData.d.ts +5 -1
  53. package/types/WalletManager.d.ts +6 -3
  54. package/types/WalletUtils.d.ts +53 -0
  55. package/types/encoding.d.ts +4 -0
  56. package/types/env.d.ts +4 -0
  57. package/types/logger.d.ts +6 -0
  58. package/types/main.d.ts +75 -2
  59. package/types/nativeScope.d.ts +10 -0
  60. package/types/types.d.ts +4 -0
  61. package/types/utils.d.ts +4 -0
  62. package/types/wasm/EmscriptenModule.d.ts +4 -0
  63. package/types/wasm/bootloader.d.ts +4 -0
  64. package/types/wasm/exceptions.d.ts +4 -0
  65. package/types/wasm/glue.d.ts +937 -170
  66. package/types/wasm/glue_manual.d.ts +4 -0
  67. package/types/wasm/loadLib.d.ts +4 -0
  68. package/types/wasm/manualGeneratedTypes.d.ts +4 -0
  69. package/types/wasm/mem.d.ts +33 -1
  70. package/types/wasm/promises.d.ts +4 -0
  71. package/types/wasm/stack.d.ts +6 -0
  72. package/types/wasm/string.d.ts +13 -0
  73. package/types/LazySequence copy.d.ts +0 -0
  74. package/types/wasm/glue copy.d.ts +0 -230
package/LICENSE.md ADDED
@@ -0,0 +1,23 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-present Knuth Project developers.
4
+ Copyright (c) 2009-2021 The Bitcoin developers
5
+ Copyright (c) 2009-2017 The Bitcoin Core developers
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,43 +1,256 @@
1
1
  # Knuth JS-WASM
2
2
 
3
- > WebAssembly interface for Bitcoin Cash full node
3
+ > Bitcoin Cash WebAssembly library for browsers and Node.js
4
4
 
5
5
  [![NPM Version](https://img.shields.io/npm/v/@knuth/js-wasm?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/@knuth/js-wasm)
6
- [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAHYcAAB2HAY%2Fl8WUAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTCtCgrAAAADB0lEQVR4XtWagXETMRREUwIlUAIlUAodQAl0AJ1AB9BB6AA6gA6MduKbkX%2BevKecNk525jHO3l%2Fp686xlJC70%2Bl0C942vjV%2Bn9FreVQbBc0wWujfRpW8Z78JaIb53hhJ1ygTA80w9PQ36duBMjHQHPCuoQZfutSjeqU1PAJN4E3j2pN7aVKv6pnWcgGawNfGa5N6prVcgGZBn8yvVXZXQbOgPXokXaPMNZwoc41D%2FaHZ8b7hpBrKjnCizIjD%2FaHZ8aPR6%2BeZXqqh7Agnyow43B%2BaZz40qnQ36a6rlsYgnChDLOkPzTN1z%2B9PafU0N3OAcaIMsaQ%2FNBufG1X9JyrtDMr0Y4xwokxlWX%2BPjAYdemhPrWeDvYcPJ8r0LO3v4oszNfivQQuTp2u9qJGKE2V6lvZ38UVj9q3t3oqEE2U2lvfXF4t6qPjTqDUV1fRyhw8nymws768vfOr2NtqOqFY4UUZE%2BusL6VDRX7%2FGzOHDiTIi0t9WMPsUKzNPx4kysf62gmuHir3sPXw4USbWny485ZOc2PsJ7VTro%2F3pwp5DxV7qHq2xa41TrY%2F2J7PfJkaHir3UwwdtU061PtqfTP0CUaYm2v3LxCtoDI2lMWk8p1of7Y8K0jhRJgaaYZwoE0P%2FpFUndZqtP6T4BE2zC5qtP6T4BE2zC5qtPyRN8OvhZUQae3ZBtT7anyb49PA6Ivp5wKnWR%2FvbJkncZXr6wokysf62CXRCWjmJxhqd2JwoE%2BuvTqS37JGJlB39GLzhRJmN5f31gz8XTpSJgWYYJ8rEQDOME2VioBnGiTIx0AzjRJkYaIZxokwMNMM4USYGmmGcKBMDzTBOlImBZhgnysRAM4wTZWKgGcaJMjHQDONEmRhohnGiTAw0wzhRJgaaYZwoEwPNME6UiYFmGCfKxEAzjBNlYqAZxokyMdAMoL%2FO%2BNi4bzjpT1e%2BNFb8V7gFzUXMLHqk%2BM1A8wArFj1S5GagOUly0SMtuxloTnJrUU%2B7QXOSW4t62g2ak9xa1NNu0Jzk1qKednK6%2Bw9roIB8keT%2F3QAAAABJRU5ErkJggg%3D%3D)](LICENSE.md)
7
- [![js-standard-style](https://img.shields.io/badge/javascript-standard%20code%20style-green.svg?style=for-the-badge)](https://github.com/feross/standard)
8
- <a target="_blank" href="https://t.me/knuth_cash">![Telegram][badge.telegram]</a>
6
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](LICENSE.md)
7
+ <a target="_blank" href="https://t.me/knuth_cash">![Telegram](https://img.shields.io/badge/telegram-chat-blue.svg?logo=telegram&style=for-the-badge)</a>
9
8
 
10
- <!-- <p align="center"><img width="800px" src="docs/images/demo.png" /></p> -->
9
+ **Knuth JS-WASM** provides Bitcoin Cash primitives through WebAssembly. Build wallets, validate addresses and work with transactions in browsers and Node.js. Version 3.0.0 uses KTH 1.5.2 and Emscripten 6.0.13.
11
10
 
12
- [Knuth JS-WASM](https://www.npmjs.com/package/@knuth/js-wasm) is a high-performance implementation of the Bitcoin Cash protocol, designed to bring node capabilities to web browsers through WebAssembly. This innovative approach allows users to interact with the Bitcoin Cash blockchain directly in their browser, leveraging the power and flexibility of the Knuth node in a JavaScript/TypeScript environment.
11
+ ## Installation
13
12
 
14
- ## Getting started with Knuth JS-WASM
13
+ ```bash
14
+ npm install @knuth/js-wasm
15
+ ```
15
16
 
16
- To get a better understanding of how to use the `Knuth JS-WASM` library, please refer to the examples provided in our repository. These examples demonstrate practical implementations of various functionalities using our library in a web environment.
17
+ ## Quick Start
17
18
 
18
- ## Examples
19
+ Load the WebAssembly module before calling native-backed APIs:
19
20
 
20
- To help you understand how to use the `Knuth JS-WASM` library, we have provided some practical examples in our repository. These examples showcase how the library can be used in web environments to interact with the Bitcoin Cash blockchain.
21
+ ```javascript
22
+ const { loadLib, PaymentAddress, Kth } = require('@knuth/js-wasm');
21
23
 
22
- Here are the examples available:
24
+ async function main() {
25
+ await loadLib(
26
+ require.resolve('@knuth/js-wasm/src/kth.wasm'),
27
+ require.resolve('@knuth/js-wasm')
28
+ );
29
+ console.log(Kth.getLibconfig().cppapiVersion); // 1.5.2
23
30
 
24
- 1. **Address Converter** ([view example](https://github.com/k-nuth/js-wasm/blob/master/examples/address-converter/index.html)): This is a web page that allows users to convert Bitcoin Cash addresses. You can input Legacy addresses, Cash Address format, or Cash Token addresses, and it will convert them into these three formats.
31
+ const address = PaymentAddress.fromString('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a');
32
+ if (address) {
33
+ console.log(address.encodedLegacy());
34
+ }
35
+ }
25
36
 
26
- 2. **Address Generator** ([view example](https://github.com/k-nuth/js-wasm/blob/master/examples/address-generator/index.html)): This example is a Bitcoin Cash address generator. It creates Cash Address format addresses from a seed in the form of a mnemonic word list.
37
+ main().catch(console.error);
38
+ ```
27
39
 
28
- For more details and examples, please visit our [examples directory](https://github.com/k-nuth/js-wasm/tree/master/examples).
40
+ The following examples assume `loadLib()` has completed.
41
+
42
+ ## Migrating to 3.0.0
43
+
44
+ - Use `ScriptFlags` / `ScriptUpgrades` and `bigint` for current script flags; for example, `script.toString(ScriptFlags.noRules)`.
45
+ - Construct wallets with `new Wallet(mnemonic, path, network)` or a seed. Release their native state with `wallet.dispose()`.
46
+ - Token amounts and satoshi values use `bigint`. Invalid token factories can return no native handle.
47
+ - APIs returning native handles transfer ownership as described by their declarations. Release owned handles with `free()` when finished.
48
+ - Recompile TypeScript consumers against the declarations shipped with this version.
49
+
50
+ ## Features
51
+
52
+ ### Address Handling
53
+
54
+ Convert between address formats and validate addresses:
55
+
56
+ ```typescript
57
+ import { PaymentAddress } from '@knuth/js-wasm';
58
+
59
+ // Parse any format (CashAddr, Legacy, CashTokens)
60
+ const addr = PaymentAddress.fromString('1P3GQYtcWgZHrrJhUa4ctoQ3QoCU2F65nz');
61
+
62
+ if (addr) {
63
+ console.log(addr.encodedCashAddr()); // bitcoincash:qrcuqadqrzp2uztjl9wn5sthepkg22majyxw4gmv6p
64
+ console.log(addr.encodedLegacy()); // 1P3GQYtcWgZHrrJhUa4ctoQ3QoCU2F65nz
65
+ console.log(addr.encodedCashTokens()); // bitcoincash:zrcuqadqrzp2uztjl9wn5sthepkg22majypyxk429j
66
+ }
67
+
68
+ // Validate addresses
69
+ const isValid = PaymentAddress.isValid('bitcoincash:qrcuqadqrzp2uztjl9wn5sthepkg22majyxw4gmv6p');
70
+ console.log(isValid); // true
71
+ ```
72
+
73
+ ### HD Wallet
74
+
75
+ Generate addresses from a BIP39 mnemonic:
76
+
77
+ ```typescript
78
+ import { Wallet } from '@knuth/js-wasm';
79
+
80
+ // Your 12 or 24-word BIP39 mnemonic
81
+ const mnemonic = ['word1', 'word2', 'word3', '...', 'word12'];
82
+ const derivationPath = "m/44'/145'/0'/0";
83
+ const network = 'MAINNET';
84
+
85
+ const wallet = new Wallet(mnemonic, derivationPath, network);
86
+
87
+ // Get a single address
88
+ const address = wallet.getAddress(0);
89
+ console.log(address.encoded()); // bitcoincash:qr9sawzzmstkluq9nqefsu7eqya4zk2w7udune2pmf
90
+
91
+ // Get multiple addresses
92
+ const addresses = wallet.getAddresses(5);
93
+ addresses.forEach((addr, i) => {
94
+ console.log(`[${i}]: ${addr.encoded()}`);
95
+ });
96
+ wallet.dispose();
97
+ ```
98
+
99
+ ### Transactions
100
+
101
+ Parse and inspect transactions:
102
+
103
+ ```typescript
104
+ import { Transaction, hexStrToBytes, encodeHash } from '@knuth/js-wasm';
105
+
106
+ const txHex = '0100000001c997a5e56e104102fa209c6a852dd90660a20b2d9c352423edce25857fcd3704000000004847304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901ffffffff0200ca9a3b00000000434104ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84cac00286bee0000000043410411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3ac00000000';
107
+
108
+ const tx = Transaction.fromData(hexStrToBytes(txHex));
109
+ if (tx) {
110
+ console.log(`TxID: ${encodeHash(tx.hash)}`);
111
+ console.log(`Size: ${tx.serializedSize(true)} bytes`);
112
+ console.log(`Inputs: ${tx.inputs?.length}`);
113
+ console.log(`Outputs: ${tx.outputs?.length}`);
114
+ }
115
+ ```
116
+
117
+ ### Scripts
118
+
119
+ Work with Bitcoin scripts:
120
+
121
+ ```typescript
122
+ import { Script, ScriptFlags, hexStrToBytes } from '@knuth/js-wasm';
123
+
124
+ // Parse a P2PKH script
125
+ const scriptBytes = hexStrToBytes('76a91406ccef231c2db72526df9338894ccf9355e8f12188ac');
126
+ const script = Script.fromData(scriptBytes, false);
127
+
128
+ if (script) {
129
+ console.log(`Type: ${script.pattern()}`); // pay_public_key_hash
130
+ console.log(`Size: ${script.serializedSize}`); // 25
131
+ console.log(script.toString(ScriptFlags.noRules)); // dup hash160 [...] equalverify checksig
132
+ }
133
+
134
+ // Create scripts from string
135
+ const multisig = Script.fromString('2 [pubkey1] [pubkey2] [pubkey3] 3 checkmultisig');
136
+ ```
137
+
138
+ ### Hashing
139
+
140
+ Cryptographic hash functions:
141
+
142
+ ```typescript
143
+ import { HashFunctions } from '@knuth/js-wasm';
144
+
145
+ const message = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
146
+
147
+ const sha256 = HashFunctions.sha256(message);
148
+ const sha256Str = HashFunctions.sha256Str(message);
149
+ const ripemd160 = HashFunctions.ripemd160(message);
150
+ const hash160 = HashFunctions.hash160(message); // SHA256 + RIPEMD160
151
+ ```
152
+
153
+ ### CashTokens Support
154
+
155
+ Parse transactions with fungible and non-fungible tokens:
156
+
157
+ ```typescript
158
+ import { Transaction, TokenDataFungible, hexStrToBytes, encodeHash } from '@knuth/js-wasm';
159
+
160
+ const tx = Transaction.fromData(hexStrToBytes(tokenTxHex));
161
+ if (tx && tx.outputs) {
162
+ const output = tx.outputs[0];
163
+
164
+ if (output.tokenData) {
165
+ console.log(`Category: ${encodeHash(output.tokenData.category)}`);
166
+ console.log(`Kind: ${output.tokenData.kind}`); // 'fungible' or 'non_fungible'
167
+
168
+ if (output.tokenData.data instanceof TokenDataFungible) {
169
+ console.log(`Amount: ${output.tokenData.data.amount}`);
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ ## Live Demo
176
+
177
+ Try it in your browser at [kth.cash](https://kth.cash/#wasm-demo) — no installation required!
178
+
179
+ ## API Reference
180
+
181
+ ### Core Classes
182
+
183
+ | Class | Description |
184
+ |-------|-------------|
185
+ | `PaymentAddress` | Address parsing, validation, and format conversion |
186
+ | `Wallet` | HD wallet with BIP39/BIP44 support |
187
+ | `Transaction` | Transaction parsing, creation, and serialization |
188
+ | `Script` | Bitcoin script handling and verification |
189
+ | `HashFunctions` | SHA256, RIPEMD160, Hash160, and more |
190
+ | `Kth` | Library configuration and version info |
191
+
192
+ ### Utilities
193
+
194
+ | Function | Description |
195
+ |----------|-------------|
196
+ | `hexStrToBytes(hex)` | Convert hex string to Uint8Array |
197
+ | `bytesToHexStr(bytes)` | Convert Uint8Array to hex string |
198
+ | `encodeHash(hash)` | Encode hash as hex string (reversed) |
199
+ | `decodeHash(hex)` | Decode hex string to hash (reversed) |
200
+ | `bitcoinToSatoshis(btc)` | Convert BCH to satoshis |
201
+ | `satoshisToBitcoin(sats)` | Convert satoshis to BCH |
202
+
203
+ ## Browser Usage
204
+
205
+ ```html
206
+ <script src="https://unpkg.com/@knuth/js-wasm@3.0.0/src/kth.js"></script>
207
+ <script>
208
+ const { loadLib, PaymentAddress } = __KTH_MODULE__;
209
+ loadLib(
210
+ 'https://unpkg.com/@knuth/js-wasm@3.0.0/src/kth.wasm',
211
+ 'https://unpkg.com/@knuth/js-wasm@3.0.0/src/kth.js'
212
+ ).then(() => {
213
+ const address = PaymentAddress.fromString('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a');
214
+ if (address) console.log(address.encodedLegacy());
215
+ }).catch(console.error);
216
+ </script>
217
+ ```
218
+
219
+ ## Requirements
220
+
221
+ - Node.js 22+ or a modern browser with WebAssembly support
222
+ - ES2020+ (uses BigInt for satoshi values)
223
+
224
+ ## Development and releases
225
+
226
+ ```sh
227
+ yarn install --frozen-lockfile
228
+ npm run tscheck
229
+ npm test
230
+ npm run check:package
231
+ ```
232
+
233
+ CI validates Node.js 22, 24 and 26. Package checks load the packed runtime and compile a TypeScript consumer against its
234
+ declarations. Pull requests and pushes to master run validation only.
235
+
236
+ To publish a version, update `package.json`, merge the reviewed change with passing CI, then publish a GitHub release
237
+ whose tag is `v<package version>`. The release workflow validates the tagged package before publishing to npm with OIDC
238
+ trusted publishing and provenance. Draft and prerelease releases do not publish to npm. The trusted publisher uses
239
+ the existing `.github/workflows/kth.yml` workflow.
29
240
 
30
241
  ## Issues
31
242
 
32
- Each of our modules has its own Github repository, but in case you want to create an issue, please do so in our [main repository](https://github.com/k-nuth/kth/issues).
243
+ Please report issues in our [main repository](https://github.com/k-nuth/kth/issues).
33
244
 
245
+ ## License
34
246
 
35
- <!-- Links -->
247
+ MIT License - see [LICENSE.md](LICENSE.md)
36
248
 
37
- [badge.Cirrus]: https://api.cirrus-ci.com/github/k-nuth/js-wasm.svg?branch=master
38
- [badge.version]: https://badge.fury.io/gh/k-nuth%2Fkth-js-wasm.svg
39
- [badge.release]: https://img.shields.io/github/release/k-nuth/js-wasm.svg
40
- [badge.c]: https://img.shields.io/badge/C-11-blue.svg?style=flat&logo=c
41
- [badge.telegram]: https://img.shields.io/badge/telegram-badge-blue.svg?logo=telegram&style=for-the-badge
42
- [badge.slack]: https://img.shields.io/badge/slack-badge-orange.svg?logo=slack&style=for-the-badge
249
+ ---
43
250
 
251
+ <p align="center">
252
+ <a href="https://kth.cash">Website</a> •
253
+ <a href="https://github.com/k-nuth">GitHub</a> •
254
+ <a href="https://t.me/knuth_cash">Telegram</a> •
255
+ <a href="https://twitter.com/KnuthNode">Twitter</a>
256
+ </p>
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@knuth/js-wasm",
3
- "version": "2.10.0",
3
+ "version": "3.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "description": "",
7
+ "description": "Bitcoin Cash WebAssembly library for browsers and Node.js",
8
8
  "main": "src/kth.js",
9
9
  "files": [
10
10
  "src/kth.js",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "types": "types/wasm/bootloader.d.ts",
16
16
  "devDependencies": {
17
- "@stylistic/eslint-plugin" : "2.10.1",
17
+ "@stylistic/eslint-plugin": "2.10.1",
18
18
  "@types/file-saver": "^2.0.7",
19
19
  "@types/jest": "^29.5.14",
20
20
  "@typescript-eslint/eslint-plugin": "^8.14.0",
@@ -29,20 +29,25 @@
29
29
  "ts-transformer-keys": "^0.4.4",
30
30
  "typescript": "^5.6.3",
31
31
  "webpack": "^5.96.1",
32
- "webpack-cli": "^5.1.4"
32
+ "webpack-cli": "^5.1.4",
33
+ "@types/node": "^22.10.0"
33
34
  },
34
35
  "scripts": {
35
- "test": "jest --runInBand --verbose"
36
+ "test": "jest --runInBand --verbose",
37
+ "tscheck": "tsc --project tsconfig.test.json --noEmit",
38
+ "check:package": "node .github/scripts/check-package.cjs"
36
39
  },
37
40
  "repository": {
38
41
  "type": "git",
39
42
  "url": "git+https://github.com/k-nuth/js-wasm.git"
40
43
  },
41
-
42
44
  "author": "Knuth Developers",
43
45
  "license": "MIT",
44
46
  "bugs": {
45
47
  "url": "https://github.com/k-nuth/kth/issues"
46
48
  },
47
- "homepage": "https://github.com/k-nuth"
49
+ "homepage": "https://github.com/k-nuth",
50
+ "engines": {
51
+ "node": ">=22"
52
+ }
48
53
  }