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

get_zero

v1.1.0

Published

Any zero you want.

Readme

What is it?

Package for getting zero in any form you want.

Installation

Run npm i get_zero or yarn add get_zero etc.

Use

import getZero from "get_zero";

Without parameter:

  • Default: getZero() returns 0 (number);

With parameter:

  • Option 1: getZero("number") returns 0 (number);
  • Option 2: getZero("string") returns "0" (string);
  • Option 3: getZero("object") returns {0: 0} (object);
  • Option 4: getZero("array_number") returns [0] (number[]);
  • Option 5: getZero("array_string") returns ["0"] (string[]);
  • Option 6: getZero("word") returns "zero" (string), automatically localized to the user's system locale;

Localizing Option 6 ("word")

By default, getZero("word") detects the current system/browser locale and returns the word for zero in that language, falling back to English ("zero") if the locale isn't recognized:

  • getZero("word") → "zero" on an English system, "cero" on a Spanish system, "zéro" on a French system, etc.

You can also force a specific locale instead of relying on auto-detection, by passing it as a second argument:

  • getZero("word", "es") returns "cero";
  • getZero("word", "fr") returns "zéro";
  • getZero("word", "de") returns "null";

Region-specific tags also work (only the base language is used) — e.g. getZero("word", "es-MX") returns "cero", getZero("word", "zh-CN") returns "零".

⚠️ The locale argument only exists on the "word" option. Passing it with any other option — e.g. getZero("number", "es") — is a TypeScript type error, not just ignored at runtime. In plain JavaScript, without type-checking, it's simply ignored for non-"word" options.

Supported locale codes

Anything not in this list falls back to English:

en, es, fr, de, it, pt, nl, sv, da, no, nb, nn, fi, is, pl, cs, sk, ro, hu, bg, hr, sr, sl, lt, lv, et, uk, ru, el, tr, he, ar, fa, ur, hi, bn, ta, te, mr, gu, pa, th, vi, id, ms, zh, ja, ko, sw, af, ca, gl, eu

In an editor like VS Code, typing getZero("word", " will pop up these codes as autocomplete suggestions — but you're not limited to them. The argument still accepts any other locale string (e.g. a region variant like "pt-BR", or a language not in the list); it just won't be offered as a suggestion.

Advanced: getLocalizedZeroWord

The localization logic behind Option 6 is also exported directly, in case you want the word without going through getZero:

import { getLocalizedZeroWord } from "get_zero";

  • getLocalizedZeroWord() returns the word for zero in the auto-detected system locale;
  • getLocalizedZeroWord("es") returns "cero";