@slnknrr/str-im 1.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.
package/LICENSE.md ADDED
@@ -0,0 +1,75 @@
1
+ Slinkin Restricted License 1.0
2
+ (A source-available license derived from the MIT License — no use in AI/ML, mandatory source attribution, email-based exceptions, Georgian governing law.)
3
+
4
+ Copyright (c) 2026 Yury Slinkin <slnknrr.dev@gmail.com>
5
+
6
+ NOTICE: THIS SOFTWARE IS SUBJECT TO A MODIFIED MIT LICENSE. IT STRICTLY PROHIBITS
7
+ ANY USE IN MACHINE LEARNING, DATASETS, OR AUTOMATED CODE GENERATION. IT MANDATES
8
+ PRESERVING MANDATORY SOURCE-LEVEL ATTRIBUTION COMMENTS IN ALL FILES. EXCEPTIONS
9
+ CAN ONLY BE GRANTED VIA VERIFIED EMAIL PROTOCOL. THIS LICENSE IS GOVERNED BY THE
10
+ LEGISLATION OF GEORGIA, GIVING ABSOLUTE PRIORITY TO TRUE AUTHORSHIP AND INALIENABLE
11
+ MORAL RIGHTS OVER DIGITAL COMMUNICATIONS.
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, subject to the following conditions:
18
+
19
+ The above copyright notice, this permission notice, the RESTRICTIONS,
20
+ FILE ATTRIBUTION REQUIREMENTS, EXCEPTIONS VIA EMAIL, and GOVERNING LAW sections
21
+ below shall be included in all copies or substantial portions of the Software.
22
+
23
+ RESTRICTIONS:
24
+ The Software, any derivative works, modifications, or products significantly
25
+ influenced by or containing logic from the Software, shall not be used,
26
+ directly or indirectly, in any of the following ways:
27
+ 1. For the creation, training, testing, fine-tuning, or validation of machine
28
+ learning (ML) models, artificial intelligence (AI) systems, or neural networks.
29
+ 2. Inclusion, scraping, or ingestion into datasets intended for machine learning,
30
+ data mining, or AI training.
31
+ 3. Use by, integration into, or analysis by automated code generation systems,
32
+ program synthesis tools, or AI coding assistants.
33
+
34
+ FILE ATTRIBUTION REQUIREMENTS:
35
+ All source code files derived from, copied from, or containing substantial portions
36
+ of the Software must retain or include a top-level header comment block containing:
37
+ 1. The original author's name and contact email (as specified in the Copyright notice).
38
+ 2. The original copyright year or date range.
39
+ 3. The origin link or source repository URL where the original code was obtained.
40
+ 4. A clear indication that the file is governed by this Restricted MIT License.
41
+ Stripping, removing, minifying out, or obscuring these header comments in source files
42
+ or derivative works is strictly prohibited and constitutes a material breach of this License.
43
+
44
+ EXCEPTIONS VIA EMAIL:
45
+ The restrictions outlined above may be waived or modified only upon explicit
46
+ written permission granted via email. To be considered authoritative, the
47
+ permission process must meet the following criteria:
48
+ 1. A formal request must be sent to the email address explicitly listed in
49
+ the Copyright notice above.
50
+ 2. The request must explicitly specify:
51
+ - The exact names of the packages, projects, or licensed products.
52
+ - The identity of the party (person or legal entity) requesting the rights.
53
+ - The exact scope, purpose of use, and the duration (time limit) of the
54
+ requested permission.
55
+ 3. A clear, affirmative response must be issued from the Copyright holder's
56
+ designated email address.
57
+
58
+ GOVERNING LAW AND TRUE OWNERSHIP:
59
+ Notwithstanding the email exception mechanism described above, this License and
60
+ any granted permissions shall be governed by and construed in accordance with
61
+ the legislation of Georgia.
62
+ The inalienable moral rights of authorship and the absolute property rights
63
+ over the Software take precedence over any digital communication. An email
64
+ permission is deemed valid and legally binding only if it is issued by the true
65
+ legal owner of the copyright. Unauthorized access to the designated email,
66
+ account compromise, or impersonation shall render any granted permission
67
+ null and void ab initio (from the beginning).
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,299 @@
1
+ # str-im
2
+
3
+ **A zero-allocation string engine. Numbers in the core, strings only at the boundary.**
4
+
5
+ `str-im` adds exactly the string operations JavaScript is missing — and nothing it already has. It never re-implements `for..of`, `indexOf`, or `slice`. It implements the things you keep hand-writing (with bugs): unique-character iterators, utf-8 buffer inspection **without decoding**, run detection, grapheme/width segmentation, mixed-script and homoglyph detection, bounded edit distance, single-pass multi-pattern search, lazy split, and entropy.
6
+
7
+ The core runs on **code units and code points as numbers**. A `number` below 2³¹ is a V8 Smi — it lives inside the pointer, so it costs zero allocations. Strings are created in exactly one place: the public boundary, when you ask for characters back. If you only ask a *question* ("how many distinct?", "is it mixed-script?", "does it fit in 120 bytes?"), no string is ever built.
8
+
9
+ ```js
10
+ import s from '@slnknrr/str-im';
11
+
12
+ s.ulen('mississippi'); // 4 — distinct chars, no strings allocated
13
+ [...s.char('mississippi')]; // ['m','i','s','p'] — unique, first-seen order
14
+ s.blen('héllo 👾'); // 11 — utf-8 byte length, computed WITHOUT encoding
15
+ s.bcut('hi 👾!', 7); // 'hi 👾' — cut to 7 utf-8 bytes; keeps the whole emoji, never half
16
+ s.mix('раypal'); // 1 — Latin + Cyrillic look-alikes: spoofing detected
17
+ s.near('kitten', 'sitting', 2); // Infinity — "not within 2 edits", answered without the full matrix
18
+ ```
19
+
20
+ ---
21
+
22
+ ## What it is
23
+
24
+ - **A precision tool for text the standard library fumbles.** utf-8 bytes, grapheme clusters, display width, scripts, confusables, edit distance, run-length structure, n-grams, entropy.
25
+ - **Lazy and bounded by default.** Iterators stop when you stop pulling. `max` lets you ask "is there more than *N*?" and leave. `near` answers "≤ *max* edits?" in `O(n·max)` time and `O(max)` space — never the full `O(n·m)`.
26
+ - **Source-agnostic.** Every method works on a `string`, a utf-8 `Uint8Array`/`Buffer`, or an `Array<number>` of code points — through a one-line adapter you can extend to your own type.
27
+ - **Regex-free classification.** Not one character class is tested with a regex (`/\p{L}/u.test(c)` forces a string allocation per character). Unicode properties are sorted `Int32Array` ranges, generated offline, queried by binary search, and materialized lazily on first use.
28
+ - **Pure ESM, dependency-free, sync.** ~1900 lines, one file, immutable tables. Node ≥ 20.
29
+
30
+ ## What it is NOT
31
+
32
+ - **Not a faster `String`/`RegExp`.** It does **not** try to out-run V8's compiled regex or `Set` at eager, single-pattern, whole-string work — that is a C++ engine and it wins, deservedly. `str-im` wins where the native idiom is forced to do work you didn't ask for. See [Performance](#performance) for the exact line.
33
+ - **Not a normalizer or transliterator.** `deburr`/`skel` are for *search and matching*, not display: `ö → o` destroys meaning in German. Normalization is `String.prototype.normalize`; `str-im` calls it, it doesn't replace it.
34
+ - **Not a full TR39 confusables database.** `skel` is NFKD + a built-in cross-script homoglyph minimum + whatever you add via `strim.confuse()`. It catches the classic `а/a`, `о/o`, fullwidth, and ligature spoofs; it is not the entire Unicode confusables file.
35
+ - **Not async, not streaming I/O.** It operates on in-memory sources. There are no promises anywhere.
36
+ - **Not mutating.** Inputs are never modified. You get a new string, a lazy iterator, or a number.
37
+
38
+ ---
39
+
40
+ ## Install
41
+
42
+ ```sh
43
+ npm install @slnknrr/str-im
44
+ ```
45
+
46
+ ```js
47
+ import s from '@slnknrr/str-im'; // ready-to-use singleton — no `new`
48
+ import { strim, _strim, NotFound, UNICODE } from '@slnknrr/str-im';
49
+ ```
50
+
51
+ Requirements: **Node ≥ 20**, ESM only (`"type": "module"` or `import`). Tables track **Unicode `UNICODE`** (currently 17.0).
52
+
53
+ ---
54
+
55
+ ## Core conventions
56
+
57
+ These are load-bearing. Learn them once; they apply everywhere.
58
+
59
+ **Predicates return `0 | 1 | -1`, not a boolean.** `0` = no, `1` = yes, `-1` = matched *in full*. `-1` is truthy, so `if (s.contains(a, b))` reads naturally — but "contains" and "equals" stay distinguishable without a second call.
60
+
61
+ ```js
62
+ s.starts('hello', 'he'); // 1
63
+ s.starts('hello', 'hello'); // -1 (equal, still truthy)
64
+ s.starts('hello', 'x'); // 0
65
+ ```
66
+
67
+ **Validation is synchronous.** A generator's body doesn't run until the first `next()`, so a naive lazy API would throw *later*, in the consumer's stack. `str-im` primes every iterator: all argument checks happen at the call site. Bad input throws *when you call*, exactly like an ordinary function.
68
+
69
+ ```js
70
+ s.char('x', 0); // throws RangeError NOW, not on first iteration
71
+ ```
72
+
73
+ **Errors are typed.** `TypeError` = wrong type. `RangeError` = index/length out of range. `NotFound` = a lookup target genuinely absent (its own class, so a missing substring is catchable apart from a real bug).
74
+
75
+ **Saturating counts return `Infinity`.** When a count is capped (`consc(str, max)`), reaching the cap yields `Infinity` — an honest "at least this many", never confused with a real result that happens to equal the cap.
76
+
77
+ **The `*char` family yields each character at most once,** in order of first appearance. That is the entire point: iterating *all* characters is what `for..of` and `str[i]` already do.
78
+
79
+ ---
80
+
81
+ ## Sources & adapters
82
+
83
+ Every reading method resolves an adapter **once** per call, then stays in a tight numeric loop. Three sources work out of the box:
84
+
85
+ | Source | Decoding | Example |
86
+ |---|---|---|
87
+ | `string` | utf-16 code units | `s.len('café')` |
88
+ | `Uint8Array` / `Buffer` | utf-8 bytes | `s.len(Buffer.from('café'))` |
89
+ | `Array<number>` | ready code points | `s.len([99, 97, 102, 233])` |
90
+
91
+ Register your own once, process-wide, and the entire method family works with it:
92
+
93
+ ```js
94
+ strim.use(MyRope, {
95
+ size: (r) => r.length, // number of units
96
+ at: (r, i) => r.codeUnitAt(i), // unit at i, as a number
97
+ dec: 0, // 0 = utf-16, 1 = utf-8 bytes, 2 = code points
98
+ });
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Performance
104
+
105
+ `str-im` is fast where laziness, bounds, single-pass multi-pattern, and *not materializing* matter. It does not compete with compiled regex on regex's turf, and says so out loud.
106
+
107
+ Representative run (`npm run bench`, Node 24.16, one machine, median of 3 — your numbers will differ; the **shape** won't):
108
+
109
+ | Case | str-im | the native way | speedup |
110
+ |---|--:|---|--:|
111
+ | "more than 8 distinct chars?" | 1.2M/s | `[...new Set(s)]` | **~1200×** |
112
+ | first line of a big blob | 1.2M/s | `s.split('\n')[0]` | **~305×** |
113
+ | truncate to 120 utf-8 bytes | 240k/s | encode + slice + repair | **~27×** |
114
+ | find any of 400 needles (1 pass) | 850/s | 400× `indexOf` | **~2.4×** |
115
+ | "edit distance ≤ 2?" | 510k/s | full DP matrix | **~1.9×** |
116
+ | grapheme count | 4k/s | `Intl.Segmenter` | ~1.0× (par) |
117
+
118
+ Why these win, structurally: the early-exit iterator **stops at 8** instead of scanning the string; lazy `split` yields the first piece instead of allocating the whole array; `bcut` **streams** the first ~120 bytes instead of encoding all 44 KB; Aho-Corasick scans **once** with cost flat in the needle count while `indexOf` pays one full scan *per needle*; banded `near` fills a diagonal stripe instead of the whole matrix. None of these is a micro-optimization — each is the native idiom being asked to do work you didn't request.
119
+
120
+ > Run it yourself: `npm run bench`.
121
+
122
+ ---
123
+
124
+ ## API
125
+
126
+ 73 methods across 13 groups. `str` accepts any registered [source](#sources--adapters). A `target` is a `string` to locate or a `number` treated as a position. `max`/`n` default sensibly. Iterator methods return lazy `IterableIterator`s.
127
+
128
+ ### 1 · Slices relative to a target — `l` = last, `b` = back
129
+ | Method | Returns |
130
+ |---|---|
131
+ | `substr(str, target, offset=∞)` | slice *after* first `target`, length `offset` |
132
+ | `lsubstr(str, target, offset=∞)` | slice after *last* `target` |
133
+ | `substrb(str, target, offset=∞)` | slice *before* first `target` |
134
+ | `lsubstrb(str, target, offset=∞)` | slice before *last* `target` |
135
+
136
+ ### 2 · Predicates — `0 / 1 / -1`
137
+ | Method | Meaning |
138
+ |---|---|
139
+ | `starts(str, target)` | starts-with (numeric target ⇒ length compare) |
140
+ | `ends(str, target)` | ends-with |
141
+ | `contains(str, target)` | includes |
142
+
143
+ ### 3 · Counters — no strings built
144
+ | Method | Counts |
145
+ |---|---|
146
+ | `len(buf)` | characters (code points) |
147
+ | `wlen(buf)` | wide chars (≥ U+10000 / surrogate pairs) |
148
+ | `ulen(buf)` | distinct characters |
149
+ | `blen(buf)` | **utf-8 byte length, without encoding** |
150
+ | `glen(buf)` | grapheme clusters (UAX #29) |
151
+ | `dlen(buf)` | display width in columns |
152
+
153
+ ### 4 · Dropping characters
154
+ | Method | Returns |
155
+ |---|---|
156
+ | `omit(str, omits)` | lazy chars of `str`, skipping `omits` |
157
+ | `omitn(str, omits)` | indices of the dropped chars |
158
+ | `clear(str, omits)` | new string without `omits` (same ref if nothing matched) |
159
+
160
+ ### 5 · Unique-character iterators — each char once, first-seen order
161
+ | Method | Yields the unique… |
162
+ |---|---|
163
+ | `char` / `wchar` / `rchar` | code units / code points / code units from the end |
164
+ | `ichar` | code points, case-folded (`A`≡`a`) |
165
+ | `vchar` / `cchar` | vowels / consonants (active alphabet) |
166
+ | `uchar` / `lchar` | uppercase / lowercase letters |
167
+ | `nchar` / `pchar` / `schar` | digits `\p{Nd}` / punctuation `\p{P}` / symbols `\p{S}` |
168
+ | `mchar` / `zchar` | combining marks `\p{M}` / invisibles `\p{Cc}∪\p{Cf}` |
169
+ | `gchar` | grapheme clusters |
170
+
171
+ All take `(str, max=∞)`.
172
+
173
+ ### 6 · Consecutive runs — `aaabb` structure
174
+ | Method | Returns |
175
+ |---|---|
176
+ | `consc` / `rconsc` | length of the first run (from start / end) |
177
+ | `cons` / `rcons` | the character of each run |
178
+ | `consg` / `rconsg` | the length of each run |
179
+ | `ucons` / `urcons` | run characters, skipping already-seen |
180
+ | `flat(str, chars?, keep=1)` | collapse repeats (`'привееет' → 'привет'`) |
181
+
182
+ ### 7 · Access by target
183
+ | Method | Returns |
184
+ |---|---|
185
+ | `has(str, target)` | char at index `±n` (code units) or the char if present, else `undefined` |
186
+ | `whas(str, target)` | same, indexed in code points |
187
+
188
+ ### 8 · Bytes & boundaries — utf-8 without materializing a string
189
+ | Method | Returns |
190
+ |---|---|
191
+ | `badn(buf)` | index of the first invalid utf-8 byte, or `-1` |
192
+ | `bom(buf)` | byte length of a leading BOM, or `0` |
193
+ | `cut(src, max, ell?)` | truncate to `max` code points, never splitting a pair |
194
+ | `bcut(src, max, ell?)` | truncate to `max` **utf-8 bytes** |
195
+ | `wcut(src, max, ell?)` | truncate to `max` grapheme clusters |
196
+
197
+ `cut`/`bcut`/`wcut` return the source's own type; `ell` (ellipsis) is charged against the same budget.
198
+
199
+ ### 9 · Search & compare
200
+ | Method | Returns |
201
+ |---|---|
202
+ | `find(str, target, {all}?)` | lazy match indices; `target` = string or many (one Aho-Corasick pass) |
203
+ | `lfind` / `ifind` | right-to-left / case-insensitive |
204
+ | `near(a, b, max=∞, {damerau}?)` | edit distance, or `Infinity` if it exceeds `max` |
205
+ | `com(a, b)` / `comb(a, b)` | length of common prefix / suffix (`b` = one string or many) |
206
+
207
+ ### 10 · Segmentation & parsing
208
+ | Method | Returns |
209
+ |---|---|
210
+ | `split(str, sep?, opts?)` | lazy pieces; `sep` absent ⇒ newlines (`\r\n\|\n\|\r` as one) |
211
+ | `splitn(str, sep?, opts?)` | piece boundaries, allocating nothing |
212
+ | `pair(str, i, opts?)` / `pairb` | matching bracket index, nesting- and quote-aware |
213
+ | `ind(str)` | `{ char, size, min, mixed }` indentation analysis |
214
+ | `dedent(str)` | strip the common indent |
215
+ | `esc(str, chars?, opts?)` / `unesc` | escape / unescape a character set |
216
+ | `trim(str, chars?)` / `rtrim` | trim a custom set (default `\p{White_Space}`) |
217
+
218
+ `opts`: `{ quote, quotes, esc, nest, limit, pairs }` — quote/escape-aware splitting and matching (CSV, shell).
219
+
220
+ ### 11 · Unicode analysis — security-grade
221
+ | Method | Returns |
222
+ |---|---|
223
+ | `scr(str, max=∞)` | unique script names |
224
+ | `mix(str)` | mixed-script check: `0` one / `1` mixed / `-1` none (ignores Common/Inherited) |
225
+ | `skel(str)` | TR39-style skeleton — visually-equal strings collapse |
226
+ | `deburr(str)` | strip diacritics (search/sort, not display) |
227
+
228
+ ### 12 · Metrics
229
+ | Method | Returns |
230
+ |---|---|
231
+ | `ent(str, base=2, n=1)` | Shannon entropy (bits by default; `n`-grams for `n>1`) |
232
+ | `gram(str, n=2)` / `wgram` | n-gram window start indices (code units / code points) |
233
+ | `hash(str, n=2)` | rolling Rabin–Karp hash of each n-gram window |
234
+
235
+ ### 13 · Second tier
236
+ | Method | Returns |
237
+ |---|---|
238
+ | `glob(str, pattern, {nocase}?)` | `* ? [abc] [a-z] [!neg]` match, `O(1)` memory, no compile |
239
+ | `style(str)` | naming style: `camel`/`pascal`/`snake`/`screaming`/`kebab`/`dot`/`mixed`/… |
240
+ | `wrap(str, width, opts?)` | width-aware line wrap (display columns, ANSI-safe) |
241
+
242
+ ### Statics & factory
243
+ | Symbol | Purpose |
244
+ |---|---|
245
+ | `strim.use(ctor, adapter)` | register a source type |
246
+ | `strim.alphabet(name, vowels?, consonants?)` | register / fetch a vowel-consonant alphabet |
247
+ | `strim.confuse(map)` | add confusable code points for `skel` |
248
+ | `_strim(overrides?)` | build a configured instance (see below) |
249
+ | `UNICODE` | Unicode version of the tables |
250
+ | `NotFound` | error class for absent targets |
251
+
252
+ ---
253
+
254
+ ## Extending & configuring
255
+
256
+ The default export is a singleton — you never write `new`. To specialize behavior (a custom terminal width, Turkish-`i` folding, tracing), pass overrides to `_strim`. An override may call `super` to wrap the original:
257
+
258
+ ```js
259
+ import { _strim } from '@slnknrr/str-im';
260
+
261
+ const traced = _strim({
262
+ find(str, target, opts) {
263
+ console.count('find');
264
+ return super.find(str, target, opts);
265
+ },
266
+ });
267
+ ```
268
+
269
+ Every internal call dispatches through `this`, so replacing one method replaces it **everywhere** it is used — no registry, no wiring.
270
+
271
+ > ### ⚠️ Keep configurations few and long-lived
272
+ > This is not a style note; it is a performance contract. Internal call sites are monomorphic and V8 inlines them to zero cost — **as long as few distinct `str-im` classes exist in the process.** Create your configuration **once, at module load**, and reuse it. `_strim` caches by the `overrides` object (a `WeakMap`), so the *same object* always yields the *same class*.
273
+ >
274
+ > Spawn more than ~4 distinct configurations and internal call sites go **megamorphic**: the inline cache degrades to a hash lookup and every allocation guarantee in this library evaporates. If you find yourself calling `_strim` in a hot path or a loop, you are holding it wrong.
275
+
276
+ ---
277
+
278
+ ## Design notes
279
+
280
+ - **Priming.** Public "generators" are ordinary methods returning an already-primed generator: they validate, cross one dummy `yield` barrier, and hand the generator back positioned at the first real value. One idle `yield` per call, zero per element — the price of synchronous errors.
281
+ - **Indices, not tuples.** Internal generators yield a single boundary *number*, never a `[value, length]` pair — the value is the element at that index, the length is the next boundary minus this one. No per-element allocation, ever. The `n`-suffixed public methods (`omitn`, `splitn`) expose those raw boundaries.
282
+ - **Tables, offline.** `\p{…}` is invoked ~30 million times *once*, at build time (`npm run tables`), and compiled to base64-VLQ delta-coded ranges. At runtime only a binary search over a lazily-materialized `Int32Array` remains. Ask about punctuation and only the punctuation table comes into existence.
283
+
284
+ ---
285
+
286
+ ## Scripts
287
+
288
+ | Command | Does |
289
+ |---|---|
290
+ | `npm test` | behavioral suite (`node --test`, zero dependencies) |
291
+ | `npm run types` | type-check the shipped declarations (`tsc --noEmit`) |
292
+ | `npm run bench` | the benchmarks above |
293
+ | `npm run tables` | regenerate `src/tables.js` from the engine's own ICU |
294
+
295
+ ---
296
+
297
+ ## License
298
+
299
+ **MIT + restrictions.** The MIT License, with added limits — chiefly no use in AI/ML training and mandatory source-attribution headers. Full terms: [Slinkin Restricted License 1.0](./LICENSE.md). © 2026 [Yury Slinkin](https://codeberg.org/slnknrr).
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@slnknrr/str-im",
3
+ "version": "1.0.0",
4
+ "description": "Zero-allocation string engine: unique-character iterators, UTF-8 buffer inspection without decoding, run detection, Unicode classification. Numbers in the core, strings only at the boundary.",
5
+ "keywords": [
6
+ "string",
7
+ "utf8",
8
+ "unicode",
9
+ "buffer",
10
+ "iterator",
11
+ "generator",
12
+ "lazy",
13
+ "zero-allocation",
14
+ "grapheme",
15
+ "codepoint",
16
+ "truncate",
17
+ "homoglyph",
18
+ "mixed-script",
19
+ "entropy",
20
+ "aho-corasick"
21
+ ],
22
+ "license": "SEE LICENSE IN LICENSE.md",
23
+ "author": "Yury Slinkin <slnknrr.dev@gmail.com>",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://codeberg.org/slnknrr/strim_lib.js-for-pm_npm.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://codeberg.org/slnknrr/strim_lib.js-for-pm_npm/issues"
30
+ },
31
+ "homepage": "https://codeberg.org/slnknrr/strim_lib.js-for-pm_npm",
32
+ "funding": "https://slnknrr.codeberg.page/funding#?npmjs=@slnknrr/str-im",
33
+ "type": "module",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./types/str-im.d.ts",
37
+ "default": "./src/str-im.js"
38
+ },
39
+ "./package.json": "./package.json"
40
+ },
41
+ "main": "./src/str-im.js",
42
+ "types": "./types/str-im.d.ts",
43
+ "files": [
44
+ "src",
45
+ "types/str-im.d.ts",
46
+ "README.md",
47
+ "LICENSE.md"
48
+ ],
49
+ "sideEffects": false,
50
+ "engines": {
51
+ "node": ">=20"
52
+ },
53
+ "scripts": {
54
+ "test": "node --test",
55
+ "bench": "node bench/index.js",
56
+ "types": "tsc -p tsconfig.json",
57
+ "tables": "node tools/build-tables.js",
58
+ "prepublishOnly": "npm run tables && npm run types && npm test"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "devDependencies": {
64
+ "typescript": "^5.9.3"
65
+ }
66
+ }