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

yes-or-no-text

v1.6.0

Published

"yes" or "no" text in many static translated languages

Readme

yes-or-no-text

A lightweight utility function to return localized "Yes" or "No" text based on a boolean or string input. Supports translations in over 50 languages with an optional language parameter.

Installation

Install the package using npm or yarn:

npm install yes-or-no-text

Usage

Import the Function

import yesOrNoText from 'yes-or-no-text'

Example Usage

//Default to English
console.log(yesOrNoText(true))//Yes
console.log(yesOrNoText(false))//No

//Specify a language
console.log(yesOrNoText(true, "fr"))//Oui
console.log(yesOrNoText(false, "es"))//No
console.log(yesOrNoText('true', "uz"))//Ha

//Unsupported languages or empty param defaults to English
console.log(yesOrNoText(true, "xyz"))//Yes
console.log(yesOrNoText(true))//Yes

API

yesOrNoText(t: boolean | string, l?: string): string

Parameters:

  • t: A boolean or string that determines the output. If truthy, returns the localized "Yes." If falsy, returns the localized "No."
  • l (optional): A string representing the desired language code. Defaults to 'en' (English).

Returns:

A localized string for "Yes" or "No" in the specified language.

Supported Languages

| Code | Language | Yes | No | | ---- | ---------- | ------ | ------ | | en | English | Yes | No | | ru | Russian | Да | Нет | | uz | Uzbek | Ha | Yo‘q | | es | Spanish | Sí | No | | fr | French | Oui | Non | | de | German | Ja | Nein | | it | Italian | Sì | No | | pt | Portuguese | Sim | Não | | zh | Chinese | 是 | 否 | | ja | Japanese | はい | いいえ | | ko | Korean | 예 | 아니요 | | ar | Arabic | نعم | لا | | tr | Turkish | Evet | Hayır | | hi | Hindi | हाँ | नहीं | | bn | Bengali | হ্যাঁ | না | | vi | Vietnamese | Có | Không | | th | Thai | ใช่ | ไม่ใช่ | | nl | Dutch | Ja | Nee | | pl | Polish | Tak | Nie | | sv | Swedish | Ja | Nej | | he | Hebrew | כן | לא | | id | Indonesian | Ya | Tidak | | ms | Malay | Ya | Tidak | | el | Greek | Ναι | Όχι | | hu | Hungarian | Igen | Nem | | ro | Romanian | Da | Nu | | cs | Czech | Ano | Ne | | sk | Slovak | Áno | Nie | | sr | Serbian | Да | Не | | hr | Croatian | Da | Ne | | sl | Slovenian | Da | Ne | | bg | Bulgarian | Да | Не | | uk | Ukrainian | Так | Ні | | lt | Lithuanian | Taip | Ne | | lv | Latvian | Jā | Nē | | et | Estonian | Jah | Ei | | fi | Finnish | Kyllä | Ei | | da | Danish | Ja | Nej | | no | Norwegian | Ja | Nei | | is | Icelandic | Já | Nei | | af | Afrikaans | Ja | Nee | | sw | Swahili | Ndio | Hapana | | ta | Tamil | ஆம் | இல்லை | | te | Telugu | అవును | కాదు | | kn | Kannada | ಹೌದು | ಇಲ್ಲ | | ml | Malayalam | അതെ | ഇല്ല | | gu | Gujarati | હા | ના | | ur | Urdu | جی ہاں | نہیں | | am | Amharic | አዎ | አይ | | fa | Persian | بله | نه | | mt | Maltese | Iva | Le | | eu | Basque | Bai | Ez | | gl | Galician | Si | Non |

License

This project is licensed under the MIT License.

Contributions

Feel free to submit issues or pull requests for additional features or translations.