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

amharic-name-search

v1.0.4

Published

Search and match Ethiopian names in both English and Amharic scripts. Perfect for building bilingual search functionality.

Readme

Amharic Name Search

A lightweight TypeScript library for transliterating and matching Ethiopian names in both English and Amharic scripts. Perfect for building bilingual search functionality.

Note: This is a transliteration library, not a search engine. Use it with databases (MongoDB, PostgreSQL), search engines (Elasticsearch), or for client-side filtering.

Quick Start

npm install amharic-name-search
import { matchesName } from 'amharic-name-search';

// Search works in both directions!
matchesName('አማኑኤል', 'amanuel'); // true ✅
matchesName('Amanuel', 'አማኑኤል'); // true ✅

// NEW: Romanization-based partial matching
matchesName('አማኑኤል', 'Ama');      // true ✅
matchesName('ተስፋዬ', 'Tes');       // true ✅
matchesName('አማኑኤል ፀጋዬ', 'Ama Tseg'); // true ✅

That's it! Now you can search for names regardless of whether they're typed in English or Amharic.

Usage

Basic Transliteration

import { transliterateToAmharic } from 'amharic-name-search';

const amharicVariants = transliterateToAmharic('amanuel');
// Returns: ['አማኑኤል']

Name Matching

import { matchesName } from 'amharic-name-search';

// Match English query with Amharic name
matchesName('አማኑኤል', 'amanuel'); // true
matchesName('አማኑኤል ፀጋዬ', 'amanuel'); // true

// Match Amharic query with English name
matchesName('Amanuel', 'አማኑኤል'); // true
matchesName('Amanuel Tsegaye', 'አማኑኤል'); // true

// Romanization-aware matching (handles \"weird\" spellings)
matchesName('ተስፋዬ', 'tesfaye');  // true  (standard)
matchesName('ተስፋዬ', 'tasfaye');  // true  (non-standard)
matchesName('ሰላም', 'Sel');      // true  (prefix)
matchesName('ዮሐንስ', 'Yoh');     // true  (prefix)

Search Query Expansion

import { expandSearchQuery } from 'amharic-name-search';

const searchTerms = expandSearchQuery('amanuel');
// Returns: ['amanuel', 'አማኑኤል']

API Reference

transliterateToAmharic(englishText, options?)

Converts English phonetic input to possible Amharic character sequences.

Parameters:

  • englishText (string): English text to transliterate
  • options (TransliterationOptions, optional): Configuration options
    • includePartialMatches (boolean, default: true): Include partial matches

Returns: string[] - Array of Amharic name variants

Example:

transliterateToAmharic('amanuel');
// ['አማኑኤል']

matchesName(name, query, options?)

Checks if a name matches a search query, considering transliteration.

Parameters:

  • name (string): The name to check (could be in Amharic or English)
  • query (string): The search query (could be in Amharic or English)
  • options (MatchOptions, optional): Configuration options
    • caseSensitive (boolean, default: false): Case-sensitive matching
    • wholeWord (boolean, default: false): Match whole words only

Returns: boolean - True if the name matches the query

Example:

matchesName('አማኑኤል', 'amanuel'); // true
matchesName('Amanuel', 'አማኑኤል'); // true

expandSearchQuery(query)

Expands a search query to include transliterated Amharic variants. Useful for database queries or search APIs.

Parameters:

  • query (string): Search query to expand

Returns: string[] - Array of search terms including original and transliterated variants

Example:

expandSearchQuery('amanuel');
// ['amanuel', 'አማኑኤል']

Use Cases

React Component Example

import { useState } from 'react';
import { matchesName } from 'amharic-name-search';

function ClientSearch({ clients }) {
  const [query, setQuery] = useState('');
  
  const filteredClients = clients.filter(client =>
    matchesName(client.name, query)
  );
  
  return (
    <div>
      <input
        value={query}
        onChange={(e) => setQuery(e.target.value)}
        placeholder="Search clients..."
      />
      <ul>
        {filteredClients.map(client => (
          <li key={client.id}>{client.name}</li>
        ))}
      </ul>
    </div>
  );
}

Database Query Example

import { expandSearchQuery } from 'amharic-name-search';

async function searchClients(query: string) {
  const searchTerms = expandSearchQuery(query);
  
  // MongoDB example
  return db.clients.find({
    $or: searchTerms.map(term => ({
      name: { $regex: term, $options: 'i' }
    }))
  });
  
  // SQL example (PostgreSQL)
  // const conditions = searchTerms.map(term => `name ILIKE '%${term}%'`).join(' OR ');
  // return db.query(`SELECT * FROM clients WHERE ${conditions}`);
}

Server-Side Filtering Example

import { matchesName } from 'amharic-name-search';

app.get('/api/clients', (req, res) => {
  const { search } = req.query;
  
  if (!search) {
    return res.json(clients);
  }
  
  const filtered = clients.filter(client =>
    matchesName(client.name, search as string)
  );
  
  res.json(filtered);
});

Supported Names

The library includes mappings for common Ethiopian names including:

  • Amanuel (አማኑኤል)
  • Tadesse (ታደሰ)
  • Tesfaye (ተስፋዬ)
  • Yohannes (ዮሐንስ)
  • Mariam (ማርያም)
  • And many more...

See src/name-mappings.ts for the complete list.

In addition to the built-in dictionary, the matcher uses:

  • A romanization layer based on the official Amharic/Ge'ez Fidel table, simplified to ASCII
  • Fuzzy and prefix matching on the Latin side

This means it can successfully match many real-world spellings that do not follow strict transliteration rules, e.g.:

  • tasfaye, tesfayeተስፋዬ
  • Ama, Aman, Amanuelአማኑኤል
  • Ama Tsegአማኑኤል ፀጋዬ

TypeScript Support

This package is written in TypeScript and includes full type definitions. No additional @types package needed.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Changelog

See CHANGELOG.md for details.