Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: joi
node v18.11.0
endpoint
share
tweet
const Joi = require("joi"); const schema = Joi.object({ name: Joi.string(), email: Joi.string().email().required(), }).external((value) => { if (value.name === "John") value.name = "Jonathan"; return value; }); const data = { name: "John", email: 'jane@example.com' }; await schema.validateAsync(data);
Created from: https://npm.runkit.com/joi
Loading…
Clone and edit this document