Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
francescovallone committed Jan 3, 2025
1 parent f97272c commit 23c7269
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 44 deletions.
57 changes: 13 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,25 @@
# Acanthis

Acanthis is a Validation library heavily inspired by [Zod](https://github.com/colinhacks/zod). It is designed to be a simple, and easy to use validation library.

## Features

Acanthis is designed to be composable. Schemas can be composed together to create more complex schemas.

Also Acanthis doesn't require any runtime dependencies, and makes use of a chainable API to create schemas.

## Getting Started
![Acanthis Banner](https://github.com/francescovallone/acanthis/raw/main/assets/github-header.png)

To get started with Acanthis, you can install it using the following command:

```bash
dart pub add acanthis
```
# Acanthis

## Example
Acanthis is a simple and easy to use validation library for Dart. It is inspired by [Zod](https://github.com/colinhacks/zod) although it is not a port of it. Acanthis is tailored to the Dart language and its features and is type-safe and composable.

Here is a simple example of how to use Acanthis:
[Get Started](hhttps://acanthis.serinus.app/introduction.html) | [Pub.dev](https://pub.dev/packages/acanthis)

```dart
import 'package:acanthis/acanthis.dart';
## Why Acanthis?

void main() {
final schema = object({
'name': string().min(3),
'age': number().positive(),
});
Acanthis provides validation for most of the Dart built-in types and allows you to create custom validators.

final result = schema.tryParse({
'name': 'Francesco',
'age': 59,
});
But that's not all! Acanthis is designed to be composable, so you can create complex validators by combining simpler ones.

/// The result is a AcanthisParseResult object
/// that has the following properties:
/// - success: A boolean that indicates if the parsing was successful or not.
/// - value: The value of the parsing. If the parsing was successful, this will contain the parsed value.
/// - errors: The errors of the parsing. If the parsing was unsuccessful, this will contain the errors of the parsing.
## Contributions

if (result.success) {
print('The schema is valid!');
} else {
print('The schema is invalid!');
}
}
```
Contributions are welcome! If you want to contribute to Acanthis, you can open a pull request on the [GitHub repository](https://github.com/francescovallone/acanthis/pulls)

As you can see if you come from a Zod background, the API is very similar and should be familiar to you.
## License

## Contributions
Acanthis is licensed under the MIT License. You can read the full license [here](https://github.com/francescovallone/acanthis/blob/main/LICENSE)

Contributions are welcome! If you want to contribute to Acanthis, you can open a pull request on the [GitHub repository](https://github.com/francescovallone/acanthis/pulls)
## Credits

Acanthis is developed and maintained by [Avesbox](https://avesbox.com)
Binary file added assets/github-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23c7269

Please sign in to comment.