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

@randajan/cs-inflect

v2.0.0

Published

A lightweight JavaScript library for declension of Czech numerals and nouns based on numbers, supporting singular, paucal (2–4), and genitive plural forms. Perfect for formatting grammatically correct strings in Czech.

Downloads

4

Readme

@randajan/cs-inflect

NPM JavaScript Style Guide

@randajan/cs-inflect is a lightweight JavaScript library for Czech declension of numerals and nouns based on numbers. It supports singular, paucal (2–4), and genitive plural forms, making it easy to generate grammatically correct strings in Czech.

Installation

Install the package using npm:

npm install @randajan/cs-inflect

Usage

Import the library and use the csInflect function to inflect numbers and format strings.

import csInflect from 'cs-inflect';

// Examples
console.log(csInflect("# sekund[y|a|y]", 1));        // "1 sekunda"
console.log(csInflect("# sekund[y|a|y]", 3));        // "3 sekundy"
console.log(csInflect("# sekund[y|a|y]", 5));        // "5 sekund"
console.log(csInflect("# hodin[a|y|]", 0, true));    // "0 hodin"
console.log(csInflect("# sekund[y|a|y]", 1.567, false, 2)); // "1.57 sekund"

Parameters

csInflect(str, num, zero = false, maxDecimal = 2)

| Parameter | Type | Default | Description | |----------------|----------|---------|-------------------------------------------------------------------------------------------------| | str | string | N/A | String with the placeholder for the number (#) and declension pattern (e.g., [y|a|y]). | | num | number | N/A | Number to be formatted and used for declension. | | zero | boolean| false | Whether to include zero (e.g., "0 sekund" if true). | | maxDecimal | number | 2 | Maximum number of decimal places for the formatted number. |

Placeholder Format

The string should contain:

  • #: Placeholder for the number.
  • Declension Pattern: A set of forms for singular, paucal, and plural in square brackets ([decimal|singular|paucal|plural]).

Example:

  • # sekund[y|a|y]: Outputs "1 sekunda", "3 sekundy", "5 sekund".
  • # hodin[a|y|]: Outputs "1 hodina", "3 hodiny", "10 hodin".

Features

  • Fast and lightweight.
  • Automatic caching of declension patterns for efficiency.
  • Handles singular, paucal, and plural forms in Czech grammar.
  • Customizable decimal formatting.

Happy hacking

License

MIT © randajan