@angadie/chittie 0.1.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 ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Asyncdot Engineering
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
+ Portions of this software are vendored from MIT-licensed projects and retain
16
+ their original copyright notices; see VENDOR.md.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @angadie/chittie
2
+
3
+ The front door to **chittie** — write a receipt once, print it on web **and** React Native. Batteries-included: the ESC/POS builder engine (`chittie-core`) + the JSX authoring layer (`chittie-react`), from one import.
4
+
5
+ > Not yet published. Installs are shown for the intended usage.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @angadie/chittie react
11
+ # plus a transport for your platform:
12
+ pnpm add @angadie/chittie-transport-web # web (Web Serial / USB / Bluetooth)
13
+ pnpm add @angadie/chittie-transport-react-native # RN/Expo (bring your own BLE/Classic/TCP)
14
+ ```
15
+
16
+ ## Usage — JSX authoring
17
+
18
+ ```tsx
19
+ import { Printer, Text, Row, Line, Cut, render } from '@angadie/chittie';
20
+ import { print } from '@angadie/chittie-transport';
21
+ import { createWebSerialTransport } from '@angadie/chittie-transport-web';
22
+
23
+ const bytes = render(
24
+ <Printer width={48}>
25
+ <Text align="center" bold>Artisan Haus</Text>
26
+ <Line />
27
+ <Row left="Flat White" right="Rs. 850" />
28
+ <Row left="Croissant" right="Rs. 650" />
29
+ <Line />
30
+ <Row left="TOTAL" right="Rs. 1500" />
31
+ <Cut />
32
+ </Printer>
33
+ );
34
+
35
+ await print(createWebSerialTransport(), bytes); // connects, then writes
36
+ ```
37
+
38
+ ## Usage — builder authoring
39
+
40
+ Same engine, no JSX:
41
+
42
+ ```ts
43
+ import { ReceiptPrinterEncoder } from '@angadie/chittie';
44
+
45
+ const bytes = new ReceiptPrinterEncoder({ columns: 48 })
46
+ .initialize()
47
+ .align('center').bold(true).line('Artisan Haus').bold(false)
48
+ .rule()
49
+ .table(
50
+ [{ width: 36, align: 'left' }, { width: 12, align: 'right' }],
51
+ [['Flat White', 'Rs. 850']]
52
+ )
53
+ .cut()
54
+ .encode();
55
+ ```
56
+
57
+ ## Sinhala / Tamil and other complex scripts
58
+
59
+ Thermal printers have no code page for Indic scripts, so they must be printed as images. chittie does this automatically when you supply a rasterizer — see [`@angadie/chittie-text`](../chittie-text). Without one, chittie **throws a clear error** rather than silently printing `?`.
60
+
61
+ ```tsx
62
+ render(receipt, { rasterizer: myCanvasRasterizer });
63
+ ```
64
+
65
+ ## What's exported
66
+
67
+ - Everything from [`@angadie/chittie-react`](../chittie-react) — `Printer`, `Text`, `Row`, `Line`, `Br`, `Cut`, `Cashdraw`, `Barcode`, `QRCode`, `render`, and the prop/option types.
68
+ - `ReceiptPrinterEncoder` — the builder engine from [`@angadie/chittie-core`](../chittie-core).
69
+
70
+ ## License
71
+
72
+ MIT.
@@ -0,0 +1,3 @@
1
+ import ReceiptPrinterEncoder from "@angadie/chittie-core";
2
+ export * from "@angadie/chittie-react";
3
+ export { ReceiptPrinterEncoder };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import ReceiptPrinterEncoder from "@angadie/chittie-core";
2
+ export * from "@angadie/chittie-react";
3
+ export { ReceiptPrinterEncoder };
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@angadie/chittie",
3
+ "version": "0.1.0",
4
+ "description": "Batteries-included receipt printing: builder + JSX authoring → ESC/POS bytes. The front door that re-exports chittie-core + chittie-react.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "types": "./dist/index.d.mts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.mts",
11
+ "import": "./dist/index.mjs"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "dependencies": {
18
+ "@angadie/chittie-core": "0.1.0",
19
+ "@angadie/chittie-react": "0.1.0"
20
+ },
21
+ "peerDependencies": {
22
+ "react": "^18 || ^19"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "tsdown",
29
+ "typecheck": "tsc --noEmit",
30
+ "test": "tsx spikes/meta.spike.tsx"
31
+ }
32
+ }