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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bshsolutions/validation

v0.0.3

Published

Validation Library for TypeScript projects

Readme

@bshg/validation

are you using this library? let us discuss on github

visit our docs site: Bshg Docs

Welcome to @bshg/validation, a versatile TypeScript library crafted for seamless data validation within your projects. Whether you're working on a front-end or back-end application, this library empowers you to validate data in a declarative manner, ensuring your objects align with your expectations.

Designed with simplicity and efficiency in mind, @bshg/validation streamlines the validation process, making it a reliable choice for your projects. It offers extensive customization options, enabling you to tailor validation rules and error messages to fit your specific requirements with ease.

This library is lightweight and has no external dependencies, ensuring fast load times and minimal impact on your application's performance. Whether you're building a web application, API, or mobile app, you can rely on @bshg/validation to handle validation consistently across platforms.

Why Choose @bshg/validation?

  • Simplicity and Efficiency: @bshg/validation is designed to be straightforward and efficient, making implementation easy while maintaining high performance.
  • Customization: The library offers extensive customization options for validation rules and error messages, providing flexibility and control tailored to your project's needs.
  • Lightweight: With no external dependencies, @bshg/validation ensures fast load times and minimal impact on performance.
  • Cross-Platform Compatibility: Suitable for both front-end and back-end applications, it ensures consistent validation across different platforms.
  • Full Stack Library: Use @bshg/validation in both frontend and backend projects, and seamlessly share validation logic between them. This makes displaying server-side validation results on the client-side straightforward and requires no extra code.
  • Autocompletion: Enhance your development experience with autocompletion support in popular IDEs like VSCode, improving coding efficiency and reducing errors.

Getting Started

Let's dive into the details of how to use this library effectively.

Installation

Install @bshg/validation via npm:

npm install @bshg/validation
yarn add @bshg/validation

Basic Usage

  1. Creating Your Type First, define the TypeScript class for your data model:

    export class User {
      username: string;
      password: string;
      fullName: string;
      age: number;
      email: string;
      phone: string;
    }
  2. Import the Library Import the v symbol, which contains all the library methods you can use:

    import { v } from '@bshg/validation';
  3. Creating a Validator for Your Type Create a validator instance for your User type:

    import { v } from '@bshg/validation';
       
    const item = new User();
       
    const validator = v.validator<User>({
      items: {
        username: v.string().required().alpha(),
        password: v.string().required().min(8),
        fullName: v.string().required(),
        email: v.string().required().email(),
        phone: v.string().required().phone(),
        age: v.number().positive(),
      }
    }).init(() => item);