npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

yuppi

v1.3.14

Published

Schemas that can be converted to Yup and JSON Schema.

Downloads

656

Readme

Contents

About

Schemas that can be converted to Yup and JSON Schema.

Features

  • Easy and understandable schema
  • Contains ready regex patterns
  • Portable schemas as a JSON file
  • Works with Yup, stable and secure
  • Schemas can be declared for TypeScript
  • It is strict and therefore does not accept more than one type
  • Error messages are ready to be understood but can be edited if desired
  • Can be converted to Yup and JSON Schema. JSON Schema is OpenAPI compatible

Installation

You can install it as follows.

# NPM
npm add yuppi

# PNPM
pnpm add yuppi

# Yarn
yarn add yuppi

# Bun
bun add yuppi

# Deno
deno add yuppi

Documentation

Tree

Briefly as follows.

Yuppi
│
├── new Yuppi(options?)
│   │
│   ├── validate(schema, properties)
│   ├── declare(schema, name)
│   ├── convertToYup(schema)
│   └── convertToJSONSchema(schema)
│
├── Patterns
│   │
│   ├── Domain
│   ├── Email
│   ├── HTTP
│   ├── PhoneNumber
│   ├── URI
│   └── Username
│
├── type AnyObject
├── type JSONSchema
├── type Schema
├── type ValidateOptions
├── type ValidationError
└── type YuppiOptions

Import

Briefly as follows.

import { Yuppi, Patterns } from 'yuppi';

Constructors

new Yuppi(options?)

Yuppi schema builder.

| Parameter | Type | Default | Description | | --------- | -------------- | --------------------- | ---------------------- | | options? | YuppiOptions | YuppiOptionsDefault | Constructor's options. |

Example:

const Yupp = new Yuppi();

Methods

Yuppi.validate(schema, properties)

Validate the properties with your Yuppi schema.

| Parameter | Type | Default | Description | | ---------- | ----------- | ------- | -------------------------- | | schema | Schema | | Yuppi schema. | | properties | AnyObject | | Properties to be validate. |

returns AnyObject

Example:

const schema: Schema = {
  display_name: {
    type: 'string',
    max: 32,
    nullable: false,
    required: true
  },

  username: {
    type: 'string',
    min: 3,
    max: 16,
    pattern: Patterns.Username,
    nullable: false,
    required: true
  },

  email: {
    type: 'string',
    pattern: Patterns.Email,
    lowercase: true,
    nullable: false,
    required: true
  }
};

const properties = {
  display_name: 'Fırat',
  username: 'fir4tozden',
  email: '[email protected]'
};

try {
  Yupp.validate(schema, properties);
  /*
    {
      display_name: "Fırat",
      username: "fir4tozden",
      email: "[email protected]"
    }
  */
} catch (error) {
  const errors = (error as ValidationError).errors;

  console.log(errors[0]); // "Field email must match the required pattern ^[a-zA-Z0-9._-]+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$"
}

Yuppi.declare(schema, name)

Declare your Yuppi schema for TypeScript.

| Parameter | Type | Default | Description | | --------- | -------- | ------- | ----------------- | | schema | Schema | | Yuppi schema. | | name | String | | Declaration name. |

returns Void

Example:

import type { User } from './yuppi/types/User';

Yupp.declare(schema, 'User');

const user = Yupp.validate(schema, properties) as User;
/*
  interface User {
    display_name: string;
    username: string;
    email: string;
  }
*/

Yuppi.convertToYup(schema)

Convert your Yuppi schema into Yup schema.

| Parameter | Type | Default | Description | | --------- | -------- | ------- | ------------- | | schema | Schema | | Yuppi schema. |

returns AnyObject

Example:

Yupp.convertToYup(schema);

Yuppi.convertToJSONSchema(schema)

Convert your Yuppi schema into JSON Schema.

| Parameter | Type | Default | Description | | --------- | -------- | ------- | ------------- | | schema | Schema | | Yuppi schema. |

returns JSONSchema

Example:

Yupp.convertToJSONSchema(schema);
/*
  {
    type: "object",
    properties: {
      display_name: {
        type: "string",
        maxLength: 32
      },
      username: {
        type: "string",
        minLength: 3,
        maxLength: 16,
        pattern: "^(?=.*[a-zA-Z])[a-zA-Z0-9][a-zA-Z0-9_]*$"
      },
      email: {
        type: "string",
        pattern: "^[a-zA-Z0-9._-]+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$"
      }
    },
    required: [ "display_name", "username", "email" ],
    additionalProperties: false
  }
*/

Patterns

| Pattern | Description | Examples | | ------------- | ------------------------------ | -------------------------------------------------------------------------------- | | Domain | Domains. | "google.com""www.google.com""https://google.com" ❌ | | Email | Emails. | "[email protected]""[email protected]" ❌ | | HTTP | HTTP only links. | "https://google.com""http://google.com""google.com" ❌ | | PhoneNumber | Country code and phone number. | "0090-555555555""90-5555555555" ❌ | | URI | Protocol free links. | "mongodb://mongodb.net""https://google.com""google.com" ❌ | | Username | Usernames like Twitter. | "fir4tozden""Fir4tozden""fir4t ozden" ❌ |

Types

| Type | | ----------------- | | AnyObject | | JSONSchema | | Schema | | ValidateOptions | | ValidationError | | YuppiOptions |

Links

License

MIT License

Copyright (c) 2025 Keift

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.