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

zodiac-mapper

v0.2.0

Published

A lightweight, zero-dependency TypeScript NPM package that maps zodiac sign names in dozens of languages and regional variants to a standardized zodiac sign enum.

Readme

✨ zodiac-mapper

npm version License

A lightweight, zero-dependency TypeScript NPM package that maps zodiac sign names in dozens of languages and regional variants to a standardized ZodiacSign enum.

🌟 Perfect for internationalized astrology apps, horoscope tools, multilingual chatbots, or any project needing robust zodiac name recognition.

Supports 50+ locales 🌍 including English, Chinese, Japanese, German, French, Spanish, Arabic, Persian, Russian, Greek, Hebrew, and more.

ℹ️ Data note: the built-in locale alias dataset was generated and curated with AI assistance. While we try to keep it accurate and conventional, it may contain mistakes or regional variations—please open an issue/PR if you spot a problem.

📦 Installation

# npm
npm install zodiac-mapper

# pnpm
pnpm add zodiac-mapper

# yarn
yarn add zodiac-mapper

🚀 Features

  • 🗺️ Universal Mapping: Map any language variant → standard zodiac enum
  • 🔍 Smart Matching: Case-insensitive, accent-insensitive, and whitespace-tolerant matching
  • 📝 Text Scanning: Find the first or all zodiac mentions in a text string
  • Zero Dependencies: Lightweight and fast
  • 🛡️ TypeScript: Fully typed for excellent developer experience

💻 Usage

import {
  createZodiacMatcher,
  findAllZodiacInText,
  findFirstZodiacInText,
  getZodiacDateRange,
  getZodiacSign,
  getZodiacSignFromDate,
  getSupportedLocales,
  ZodiacSign,
} from "zodiac-mapper";

// 1) Map a single name to a ZodiacSign (or null if unknown)
getZodiacSign("Taureau") === ZodiacSign.TAURUS;
getZodiacSign("Unknown") === null;

// 2) Scan text: find the first match (or null if none)
const first = findFirstZodiacInText("My sign is Löwe");
// first => { sign: ZodiacSign.LEO, match: "Löwe", index: 11 }

// 3) Scan text: find all matches (empty array if none)
const all = findAllZodiacInText("Aries, Taurus, and Löwe");
// all => [
//   { sign: ZodiacSign.ARIES, match: "Aries", index: 0 },
//   { sign: ZodiacSign.TAURUS, match: "Taurus", index: 7 },
//   { sign: ZodiacSign.LEO, match: "Löwe", index: 19 },
// ]

// Inspect available locale data keys
const locales = getSupportedLocales();
// locales => ["en", "fr", "de", ...]

// 4) Reuse a matcher with fixed options (saves repeated option passing)
const ptOnly = createZodiacMatcher({ includeLocales: ["pt"] });
ptOnly.getZodiacSign("Áries") === ZodiacSign.ARIES;

// 5) Date helpers (tropical / Western zodiac)
getZodiacDateRange(ZodiacSign.ARIES);
// => { start: { month: 3, day: 21 }, end: { month: 4, day: 19 }, crossesYear: false }

getZodiacSignFromDate({ month: 3, day: 21 }) === ZodiacSign.ARIES;
getZodiacSignFromDate("2000-03-21") === ZodiacSign.ARIES;
getZodiacSignFromDate("03-21") === ZodiacSign.ARIES;

🌍 Locale Filtering (include / exclude)

When scanning free text, limiting languages can reduce false positives.

// Only match Portuguese
getZodiacSign("Áries", { includeLocales: ["pt"] });

// Scan text but exclude Portuguese
findFirstZodiacInText("I am Áries", { excludeLocales: ["pt"] });

📝 Notes

  • Locales are treated as BCP-47 tags; tags like zh-Hant will be treated as zh for filtering.
  • symbols is a special built-in pseudo-locale key (not a BCP-47 tag).
  • The default is permissive (all locales). This is great for astrology-specific text, but can be noisy in general-purpose text.