kanun 0.1.8 → 1.0.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/README.md +15 -0
- package/dist/index.cjs +1491 -1227
- package/dist/index.d.ts +281 -103
- package/dist/index.js +1481 -1227
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -13,6 +13,12 @@ Framework-agnostic TypeScript-first validation library. Provides a rich set of b
|
|
|
13
13
|
npm install kanun
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
For file validation, install the separate plugin package:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install kanun @kanun-hq/plugin-file
|
|
20
|
+
```
|
|
21
|
+
|
|
16
22
|
## Features
|
|
17
23
|
|
|
18
24
|
- Rule-based validation — Supports common rules like required, min, max, email, url, numeric, boolean, in, regex, etc.
|
|
@@ -35,6 +41,7 @@ npm install kanun
|
|
|
35
41
|
|
|
36
42
|
- TypeScript-first design — Full type inference for rules, messages, and validated data.
|
|
37
43
|
- Chainable API — Optional fluent syntax for building validators.
|
|
44
|
+
- Plugin system — Install optional rule packs without expanding the core bundle.
|
|
38
45
|
|
|
39
46
|
## Usage
|
|
40
47
|
|
|
@@ -148,6 +155,14 @@ const validator = new Validator(
|
|
|
148
155
|
);
|
|
149
156
|
```
|
|
150
157
|
|
|
158
|
+
### Plugins
|
|
159
|
+
|
|
160
|
+
Kanun supports installable plugins such as `@kanun-hq/plugin-file`.
|
|
161
|
+
|
|
162
|
+
Plugin usage, file validation rules, and framework upload adapters are fully documented:
|
|
163
|
+
|
|
164
|
+
- https://arkstack-hq.github.io/kanun/guide/plugins
|
|
165
|
+
|
|
151
166
|
For the complete guide and API reference, visit the docs site: https://arkstack-hq.github.io/kanun
|
|
152
167
|
|
|
153
168
|
## Code of Conduct
|