Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openpeeps/bag
Validate form input data in a fancy way. Written in Nim language
https://github.com/openpeeps/bag
bag form form-validation input-validation nim-lang
Last synced: about 2 months ago
JSON representation
Validate form input data in a fancy way. Written in Nim language
- Host: GitHub
- URL: https://github.com/openpeeps/bag
- Owner: openpeeps
- License: mit
- Created: 2023-02-08T13:55:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T00:53:18.000Z (9 months ago)
- Last Synced: 2024-04-24T01:54:51.823Z (9 months ago)
- Topics: bag, form, form-validation, input-validation, nim-lang
- Language: Nim
- Homepage: https://openpeeps.github.io/bag
- Size: 49.8 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Validate HTTP input data in a fancy way.
👑 Written in Nim language
nimble install bag
## 😍 Key Features
- [x] Macro-based validation
- [x] Framework agnostic
- [x] i18n support
- [x] Based on [Valido package](https://github.com/openpeeps/valido)
- [x] Open Source | `MIT` License
- [x] Written in 👑 Nim language## Examples
```nim
# can be a seq/array containing a key/value tuple (string, string)
var data = [("email", "[email protected]"), ("password", "123admin")]# create a new bag
bag data:
email: tEmail or "auth.error.email"
password: tPassword or "auth.error.password":
min: 8 or "auth.error.password.min"
*remember: tCheckbox # `*` prefix makes field optional
do:
for err in inputBag.getErrors:
echo err
```For more examples, check in [unittests](https://github.com/openpeeps/bag/blob/main/tests/test1.nim)
### ❤ Contributions & Support
- 🐛 Found a bug? [Create a new Issue](https://github.com/openpeeps/bag/issues)
- 👋 Wanna help? [Fork it!](https://github.com/openpeeps/bag/fork)
- 😎 [Get €20 in cloud credits from Hetzner](https://hetzner.cloud/?ref=Hm0mYGM9NxZ4)
- 🥰 [Donate via PayPal address](https://www.paypal.com/donate/?hosted_button_id=RJK3ZTDWPL55C)### 🎩 License
Bag | MIT license. [Made by Humans from OpenPeeps](https://github.com/openpeeps).
Copyright © 2024 OpenPeeps & Contributors — All rights reserved.