tamil-toolkit 0.0.0-stage → 0.1.0-alpha.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tamil-toolkit contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # tamil-toolkit for TypeScript / WASM
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `just sync-bindings` produces Node and browser WASM builds and TypeScript
4
+ declarations. Node: `import * as tamil from 'tamil-toolkit'`. Browser:
5
+ `import { init, get_letters } from 'tamil-toolkit/web'; await init();`.
6
+ Install the experimental MIT-licensed alpha on npm with `npm install tamil-toolkit@alpha`.
7
+ These adapters serialize calls into the shared Rust dispatcher. Planned modules
8
+ are excluded. APIs may change before stability. Node 22+ is supported; browser
9
+ consumers must initialize the WASM module before calling its functions.
10
+
11
+ ```javascript
12
+ import { format_fraction, format_currency } from "tamil-toolkit";
13
+
14
+ console.log(format_fraction(2, 4)); // 1/2
15
+ console.log(format_currency(102550, "LKR", "SL")); // LKR 1,025.50
16
+ ```
17
+
18
+ The package includes core Unicode/Ezhuthu functions, Agara collation, bounded
19
+ TN/SL integer and currency words, fractions, Gregorian dates, and explicit
20
+ Bamini and bounded TSCII, TAB, TAM and Anjal byte conversion. For browser code use the `/web` entry point, `await init()`,
21
+ then call the same methods. Hosts must serve the packaged WASM file with the
22
+ generated loader; bundlers must support WebAssembly assets and ES modules.
23
+ See LICENSE, THIRD_PARTY_NOTICES.md, and bundled dependency license notices.
24
+
25
+ Both entry points expose `compare`, `sort_words`, `sort_key`, and `search_key`.
26
+ Use the comparison result or numeric-array keys for ordering; comparing their
27
+ JSON string representation is incorrect. The versioned `agara-v1` profile and
28
+ its mixed-script fallback are specified at
29
+ https://github.com/abishtakan/tamil-toolkit/tree/HEAD/docs/specs/collate-v0.1.md.
30
+
31
+ This distribution provides `tscii_bytes_to_unicode(new Uint8Array([0xba, 0xa2, 0xc5, 0xfd]))`.
32
+
33
+ `unicode_to_tscii_bytes(text)` returns an array of byte values.
34
+
35
+ This distribution provides `tab_bytes_to_unicode(bytes)` and `unicode_to_tab_bytes(text)`.
36
+
37
+ This distribution provides `tam_bytes_to_unicode(bytes)` and `unicode_to_tam_bytes(text)`; TAM bytes do not preserve Latin letters.
38
+
39
+ This distribution provides `anjal_bytes_to_unicode(bytes)` and `unicode_to_anjal_bytes(text)`; ambiguous legacy bytes raise an error.