Satiro
Why Satiro?
What is the purpose of this package?
Installation
npm install --save satiroIntroduction and Usage
Schema creator (Zod):
import { z } from 'zod';
import { createPasswordSchema, PasswordCriteriaExamplesEnum } from 'satiro';
// Create a Zod schema for passwords with custom requirements
const passwordSchema = createPasswordSchema({
minLength: 8,
maxLength: 128,
minUppercase: 1,
minLowercase: 1,
minDigits: 1,
minSpecialChars: 1,
});
// Use with Zod
const result = passwordSchema.safeParse('P@ssw0rd');
if (!result.success) {
console.log(result.error.format());
}
// Or use predefined criteria
const strongPasswordSchema = createPasswordSchema(
PasswordCriteriaExamplesEnum.STRONG
);Standalone validator:
Predefined Criteria Examples
Documentation
Donations
Last updated