Một mục tập trung giao diện trong kho dữ liệu GitHub của TopGit: imbrn/v8n, 4.1k sao, nhóm Frontend, JavaScript. ☑️ JavaScript fluent validation library
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
The ultimate JavaScript validation library you've ever needed.
Dead simple fluent API. Customizable. Reusable.
Installation -
Documentation -
API
Introducing v8n
v8n is an acronym for validation. Notice that it has exactly
eight letters between v and n in the "validation" word. This is the
same pattern we are used to seeing with i18n, a11y, l10n ...
Chainable API
Create validations very easily with its chainable API:
v8n()
.some.not.uppercase() // expects that some character is not uppercase
.test("Hello"); // true
v8n()
.not.some.uppercase() // expects that no character is uppercase
.test("Hello"); // false
Notice how we made very different validation strategies just by changing the
order of the modifiers. It's so intuitive that seems to be impossible, but this
is v8n.
Customizable
Create your own custom validation rules in a very intuitive way:
function foo() {
return value => value === "bar";
}
v8n.extend({ foo });
v8n will treat them like built-in ones:
v8n()
.string()
.foo()
.test("bar"); // true
Reusable
Export validations just like you're used to do with your JavaScript modules:
import specialNumber from "../specialNumber";
specialNumber.test(63); // true
For any kind of data
Use v8n to validate your data regardless of its type. You can validate
primitives, arrays, objects and whatever you want! You can also use them
together!
Do simple validations with boolean based tests. Get more information about your
validation process with exception based tests. And of course, perform
asynchronous tests as well. All in one library.
Share your rules with the world, and use theirs as well.
Create useful validation rules and share them with the open source community,
and let people around the world validate without reinventing the wheel.
Ready to use!
There are a lot of built-in rules and modifiers for you to use already
implemented in v8n's core. Take a look at all of them in our
API page. But if you can't find what you
need, go ahead and make it.
Tiny!
All these incredible features for just a few bytes:
Architecture
The v8n core is composed of rules and modifiers. They are used together
to build complex validations in an easy way.
Rules
Rules are the heart of the v8n ecosystem. You use them to build your
validation strategies:
In this code snippet, we're using two rules (string and minLength) to build
our validation strategy. So our validated value ("Hello") is valid because
it's a string and it is at least 3 characters long.
Rules can be more powerful if used along with modifiers. Learn about them in
the next section.
Modifiers
Modifiers can be used to change rules meaning. For example, you can use the
not modifier to expect the reversed result from a rule:
v8n()
.not.equal(5)
.test(5); // false
You can check all available modifiers on our documentation page.
Modifiers are very powerful. They work as decorators for rules. When used
together, they allow you to build very complex validations.
Contribute
Contributions of any kind are welcome! Read our
CONTRIBUTING guide.
imbrn/v8n thuộc nhóm Frontend trên TopGit, cùng 3 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về imbrn/v8n ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/imbrn/v8n là nguồn chính thức.
imbrn/v8n có bao nhiêu sao?
imbrn/v8n có 4.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/imbrn/v8n. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
imbrn/v8n có phải mã nguồn mở không?
Có — imbrn/v8n phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/imbrn/v8n.
imbrn/v8n còn đang phát triển không?
Commit gần nhất trên imbrn/v8n là 1.9 năm trước (theo timestamp GitHub). Repo có 103 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
imbrn/v8n dùng license gì?
imbrn/v8n phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
imbrn/v8n là gì?
imbrn/v8n (imbrn/v8n) là dự án JavaScript trên GitHub. Theo mô tả gốc: ☑️ JavaScript fluent validation library
imbrn/v8n viết bằng ngôn ngữ gì?
imbrn/v8n chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về v8n?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về v8n.