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

@elmenov-softworks/eslint-plugin-between

v1.0.1

Published

ESLint plugin that checks inclusive TypeScript numeric ranges, arithmetic, and function contracts.

Readme

ESLint Plugin Between

Check inclusive numeric ranges in TypeScript with ESLint. Assignments, arithmetic, function arguments, and return values are checked against Between<Min, Max> and aliases such as Byte.

let opacity: Between<0, 1> = 0.5;
opacity = 1.5; // Error: outside [0, 1]

Setup

npm install --save-dev eslint @elmenov-softworks/eslint-plugin-between @typescript-eslint/parser typescript

Create eslint.config.mjs:

import parser from '@typescript-eslint/parser';
import between from '@elmenov-softworks/eslint-plugin-between';

export default [
  {
    ...between.configs.recommended,
    files: ['**/*.ts', '**/*.tsx'],
    languageOptions: { parser },
  },
];

Add the declarations to tsconfig.json, keeping any existing types entries:

{
  "compilerOptions": {
    "types": ["@elmenov-softworks/eslint-plugin-between/types"]
  }
}

Run npx eslint .. For editor diagnostics, enable the ESLint extension for TypeScript files. No parserOptions.project setting is required.

Examples

Function contracts:

function setChannel(value: Byte): Byte {
  return value;
}

setChannel(128); // Valid
setChannel(256); // Error: outside [0, 255]

Arithmetic and narrowing:

function brighten(channel: Byte): Byte {
  if (channel <= 245) {
    return channel + 10; // Valid: result is within [10, 255]
  }

  return 255;
}

Ranges are inclusive and allow fractions. Unknown values are errors by default. Types erase to ordinary numbers: there is no runtime validation, clamping, or wrapping. tsc alone does not check ranges; run ESLint alongside the compiler.

Compatibility and documentation

ESLint 9 or 10 with flat config, TypeScript >=5.0.0 <6.1.0, and Node.js ^20.19.0 || ^22.13.0 || >=24.0.0. The package exports ESM JavaScript.

For development: npm ci, npm run build, and npm run check. npm pack creates a checked, installable archive.

MIT license. See LICENSE.