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

v9sx

v1.0.1

Published

v9s extensions

Readme

v9sx

This library contains a number of additional validation rules, modifiers and injections that may be useful to v9s users.

Build Status

Contents

  1. Installation
  2. Rules
    1. E-mail
    2. Float string
    3. HEX string
    4. Integer string
    5. Russian postal code
  3. Modifiers
    1. Compact
    2. Replace factory
    3. To lower case
    4. To upper case
    5. Trim end
    6. Trim start
    7. Trim
  4. Injections
  5. License

Installation

npm install v9sx

Rules

Additional rules.

E-mail

The rule checks an E-mail validness.

import { v9s, simplify } from 'v9s';
import { email } from 'v9sx';

const check = simplify(v9s(false).use(email));

console.log(check('[email protected]')); // true
console.log(check('example.com')); // false

Float string

The rule checks a float string validness.

import { v9s, simplify } from 'v9s';
import { float } from 'v9sx';

const check = simplify(v9s(false).use(float));

console.log(check('123.60')); // true
console.log(check('-123.60')); // true
console.log(check('+123.60')); // false
console.log(check('123')); // true
console.log(check('123,60')); // true
console.log(check('1 123.60')); // false

HEX string

The rule checks the validness of a lowercase HEX string.

import { v9s, simplify } from 'v9s';
import { hex } from 'v9sx';

const check = simplify(v9s(false).use(hex));

console.log(check('123abc')); // true
console.log(check('123ABC')); // false

Integer string

The rule checks an integer string validness.

import { v9s, simplify } from 'v9s';
import { integer } from 'v9sx';

const check = simplify(v9s(false).use(integer));

console.log(check('123456')); // true
console.log(check('123 456')); // false
console.log(check('-123456')); // true
console.log(check('123,456')); // false

Russian postal code

The rule checks a Russian postal code validness.

import { v9s, simplify } from 'v9s';
import { ruPostalCode } from 'v9sx';

const check = simplify(v9s(false).use(ruPostalCode));

console.log(check('123456')); // true
console.log(check('123-456')); // false

Modifiers

Data modifiers.

Compact

Removes space characters inside a value.

import { v9s, simplify } from 'v9s';
import { compact } from 'v9sx';

const check = simplify(v9s(false).use(compact));

console.log(check('1 \t 234 567')); // '1234567'

Replace factory

Returns a modifier function that replaces a substring.

import { v9s, simplify } from 'v9s';
import { replaceFactory } from 'v9sx';

To lower case

Modifies a value to lowercase.

import { v9s, simplify } from 'v9s';
import { toLowerCase } from 'v9sx';

const check = simplify(v9s(false).use(toLowerCase));

console.log(check('ABCDEFГДЕЁЖ')); // 'abcdefгдеёж'

To upper case

Modifies a value to uppercase.

import { v9s, simplify } from 'v9s';
import { toUpperCase } from 'v9sx';

const check = simplify(v9s(false).use(toUpperCase));

console.log(check('abcdefгдеёж')); // 'ABCDEFГДЕЁЖ'

Trim end

Removes spaces at the beginning of a value.

import { v9s, simplify } from 'v9s';
import { trimEnd } from 'v9sx';

const check = simplify(v9s(false).use(trimEnd));

console.log(check('  \t   hello, world!   \t ')); // '  \t   hello, world!'

Trim start

Removes spaces at the end of a value.

import { v9s, simplify } from 'v9s';
import { trimStart } from 'v9sx';

const check = simplify(v9s(false).use(trimStart));

console.log(check('  \t   hello, world!   \t ')); // 'hello, world!   \t '

Trim

Removes the leading and trailing white space and line terminator characters from a string.

import { v9s, simplify } from 'v9s';
import { trim } from 'v9sx';

const check = simplify(v9s(false).use(trim));

console.log(check(' \t hello, world!   \t')); // 'hello, world!'

Injections

Injections that extends a behavior of v9s.

LICENSE

MIT