Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 29, 2024 via pnpm

joi 17.12.1

Object schema validation
Package summary
Share
0
issues
1
license
6
BSD-3-Clause
Package created
16 Sep 2012
Version published
29 Jan 2024
Maintainers
6
Total deps
6
Direct deps
5
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
@hapi/hoek@9.3.0
@hapi/topo@5.1.0
@sideway/address@4.1.5
@sideway/formula@3.0.1
@sideway/pinpoint@2.0.0
joi@17.12.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
β“˜ This is a list of joi 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@hapi/hoek9.3.013.31 kBBSD-3-Clause
prod
@hapi/topo5.1.03.72 kBBSD-3-Clause
prod
@sideway/address4.1.515.69 kBBSD-3-Clause
prod
@sideway/formula3.0.14.63 kBBSD-3-Clause
prod
@sideway/pinpoint2.0.01.85 kBBSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does joi do?

Joi is a powerful schema description language and data validator for JavaScript. It is highly robust and aids in ensuring data integrity by validating JavaScript objects against predefined schemas. Joi can enforce a complex set of rules on an object and ensure it matches the expected schema. It is perfect for ensuring data consistency, especially when dealing with input or output data, such as form submission data or API response structures.

How do you use joi?

To use Joi, you need to first install the package using npm by executing npm install joi in your command line interface. Once installed, you can require it in your JavaScript files and utilize it to create schemas and validate objects. Here is a basic example of creating a schema and validating an object:

const Joi = require('joi');

// Define a schema
const schema = Joi.object({
    name: Joi.string().required(),
    email: Joi.string().email().required(),
    age: Joi.number().integer().min(18)
});

// Object to be validated
const user = {
    name: 'John Doe',
    email: 'john.doe@example.com',
    age: 25
};

// Validate the object against the schema
const validation = schema.validate(user);
if (validation.error) {
    console.log(validation.error.details);
} else {
    console.log('Validation passed!');
}

In this example, we're validating a user object. If the user data doesn't adhere to the schema rules, you'll get a console log of errors, otherwise, it displays 'Validation passed!'.

Where are the joi docs?

The detailed documentation for Joi can be easily accessed through the official joi.dev Developer Portal. For specifics regarding functions, you can visit the documentation and API page. Updates about the various version statuses can be found on the versions status page and any potential changes to the library can be tracked through their changelog. The project's policies, ethos, and how to contribute are outlined on the project policies page.