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

kotunil-js-lib

v5.0.3

Published

KotUniL JavaScript/TypeScript library covers all units of International System of Units (SI) like meter, second etc. (see Wikipedia: https://en.wikipedia.org/wiki/International_System_of_Units) as well as SI- Prefixes (micro, nano etc.) and some other co

Readme

KotUniL JavaScript Library

This is the JavaScript/TypeScript distribution of the KotUniL library, available as NPM package kotunil-js-lib.

Purpose

This library provides:

  • JavaScript/TypeScript implementation of KotUniL units library
  • Cross-platform compatibility for web browsers and Node.js
  • TypeScript definitions for type-safe development
  • ES2016 target for broad browser compatibility

Installation

NPM

npm install kotunil-js-lib

Yarn

yarn add kotunil-js-lib

Usage

TypeScript

import { m, s, kg, N } from 'kotunil-js-lib';

const distance = 100 * m;
const time = 10 * s;
const velocity = distance / time;
console.log(`Velocity: ${velocity.value} ${velocity.unitSymbols()}`);

JavaScript (ES6+)

import { m, s, kg, N } from 'kotunil-js-lib';

const distance = 100 * m;
const time = 10 * s;
const velocity = distance / time;
console.log(`Velocity: ${velocity.value} ${velocity.unitSymbols()}`);

JavaScript (CommonJS)

const { m, s, kg, N } = require('kotunil-js-lib');

const distance = 100 * m;
const time = 10 * s;
const velocity = distance / time;
console.log(`Velocity: ${velocity.value} ${velocity.unitSymbols()}`);

Compatibility

JavaScript Engine Support

  • Node.js: 14.0.0+ (LTS versions recommended)
  • Browsers: All supporting ES2016
    • Chrome 52+
    • Firefox 50+
    • Safari 10+
    • Edge 14+
  • TypeScript: Full type definitions included

Testing Strategy

This library is tested with the newest available JavaScript engines to ensure forward compatibility as part of our three-phase version strategy.

Features

  • Complete SI unit system implementation
  • Type-safe operations with TypeScript
  • Runtime dimensional analysis
  • Currency and percentage support
  • Minimal bundle size with tree-shaking support
  • Zero dependencies

API Reference

The JavaScript API mirrors the Kotlin API with some platform-specific adaptations:

Basic Usage

// Creating units
const length = 5 * m;
const time = 2 * s;

// Calculations
const velocity = length / time;
const acceleration = velocity / time;

// Accessing values
console.log(velocity.value);           // Numeric value
console.log(velocity.unitSymbols());   // "m/s"
console.log(velocity.categorySymbols()); // "LT-1"

Error Handling

try {
    const invalid = 1 * m + 1 * s;  // Will throw
} catch (error) {
    console.log("Dimensional error:", error.message);
}

Building from Source

This library is automatically generated from the Kotlin multiplatform project:

./gradlew :js-lib:clean
./gradlew :js-lib:build

The generated package can be found in js-lib/dist/.