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

eseries

v1.0.2

Published

E-series preferred values library (E12, E24, etc.) for electronic components

Readme

ESeries

A TypeScript library for working with E-series preferred values commonly used in electronic components.

This project is a TypeScript port of the original Python eseries library by Rob Smallshire.

Installation

npm install eseries

Usage

import { 
  ESeries, 
  findNearest, 
  findGreaterThan, 
  findLessThan, 
  erange, 
  tolerance 
} from 'eseries';

// Find the closest E24 value to 42
const nearest = findNearest(ESeries.E24, 42);
console.log(nearest); // 43

// Get all E12 values between 10 and 100
const values = erange(ESeries.E12, 10, 100);
console.log(values); // [10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82]

// Find the tolerance of an E6 series
const tol = tolerance(ESeries.E6);
console.log(tol); // 0.2 (20%)

All Functions

Core Functions

import { ESeries, series, seriesKeys, seriesKeyFromName } from 'eseries';

// Available E-series
console.log(seriesKeys()); // [3, 6, 12, 24, 48, 96, 192]

// Get base values of a series
console.log(series(ESeries.E12)); // [10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82]

// Get a series from its name
console.log(seriesKeyFromName('E24')); // 24

Finding Values

import { 
  ESeries, 
  findNearest, 
  findNearestFew, 
  findGreaterThan, 
  findGreaterThanOrEqual,
  findLessThan,
  findLessThanOrEqual
} from 'eseries';

// Find the closest E24 value to 42
console.log(findNearest(ESeries.E24, 42)); // 43

// Find the 2 nearest E24 values to 42
console.log(findNearestFew(ESeries.E24, 42, 2)); // [39, 43]

// Find value greater than 42
console.log(findGreaterThan(ESeries.E24, 42)); // 43

// Find value greater than or equal to 43
console.log(findGreaterThanOrEqual(ESeries.E24, 43)); // 43

// Find value less than 42
console.log(findLessThan(ESeries.E24, 42)); // 39

// Find value less than or equal to 39
console.log(findLessThanOrEqual(ESeries.E24, 39)); // 39

Value Ranges

import { ESeries, erange, openErange } from 'eseries';

// Get all E12 values between 10 and 100 (inclusive)
console.log(erange(ESeries.E12, 10, 100));
// [10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82, 100]

// Get all E12 values between 10 and 100 (excluding 100)
console.log(openErange(ESeries.E12, 10, 100));
// [10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82]

Tolerance Functions

import { 
  ESeries, 
  tolerance, 
  lowerToleranceLimit, 
  upperToleranceLimit, 
  toleranceLimits 
} from 'eseries';

// Get tolerance of an E6 series (20%)
console.log(tolerance(ESeries.E6)); // 0.2

// Get lower tolerance limit of a value
console.log(lowerToleranceLimit(ESeries.E6, 100)); // 80

// Get upper tolerance limit of a value
console.log(upperToleranceLimit(ESeries.E6, 100)); // 120

// Get both limits as a tuple
console.log(toleranceLimits(ESeries.E6, 100)); // [80, 120]

Formatting Functions

import { engString, roundSig } from 'eseries';

// Format a number with engineering notation and SI prefix
console.log(engString(0.00000123)); // "1.23 µ"
console.log(engString(4700)); // "4.7 k"

// Format a number with plain engineering notation (no prefix)
console.log(engString(4700, 3, false)); // "4700"

// Round to significant figures
console.log(roundSig(123.456789, 4)); // 123.5

CLI

The package includes a command-line interface:

# Find the nearest E24 value to 42
eseries nearest E24 42

# Find values greater than or equal to 42
eseries ge E24 42 --symbol

# Show all E12 values between 10 and 100
eseries range E12 10 100

Run eseries --help for more information.

License

MIT