Skip to content

Commit 820f910

Browse files
authoredJan 22, 2020
Update README.md
1 parent 402874a commit 820f910

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed
 

‎README.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# Yup
22

3-
Yup is a JavaScript object schema validator and object parser. The API and style is ~~stolen~~ heavily inspired
4-
by [Joi](https://github.com/hapijs/joi), which is an amazing library but is generally too large and difficult
5-
to package for use in a browser. Yup is leaner: in the same spirit, without some of the fancy features.
6-
You can use it on the server as well, but in that case you might as well just use Joi.
3+
Yup is a JavaScript schema builder for value parsing and validation. Define a schema, transform a value to match, validate the shape of an existing value, or both. Yup schema are extremely expressive and allow modeling complex, interdependent validations, or value transformations.
74

8-
Yup is also a good bit less opinionated than joi, allowing for custom transformations and async validation.
9-
It also allows "stacking" conditions via `when` for properties that depend on more than one other sibling or
10-
child property. Yup separates the parsing and validating functions into separate steps so it can be used to parse
11-
json separate from validating it, via the `cast` method.
5+
Yup's API is heavily inspired by [Joi](https://github.com/hapijs/joi), but leaner and built with client-side validation as it's primary use-case. Yup separates the parsing and validating functions into separate steps. `cast()` transforms data while `validate` checks that the input is the correct shape. Each can be preformed together (such as form HTML form validation) or seperately (such as deserializing trusted data from API's).
126

137
**Try it out:** https://runkit.com/jquense/yup#
148

@@ -122,11 +116,7 @@ npm install -D @types/yup
122116

123117
## Usage
124118

125-
You define and create schema objects. Schema objects are immutable, so each call of a method returns a _new_ schema object.
126-
127-
**try it out using tonicdev! https://tonicdev.com/570c52590a85f71200eb09ba/yup**
128-
129-
When using es module syntax, yup exports everything as a named export
119+
You define and create schema objects. Schema objects are immutable, so each call of a method returns a _new_ schema object. When using es module syntax, yup exports everything as a named export
130120

131121
```js
132122
import * as yup from 'yup'; // for everything

1 commit comments

Comments
 (1)

john-raymon commented on Jan 29, 2020

@john-raymon

I noticed this change heavily for some reason lol.

Please sign in to comment.