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

nigeria-translator

v1.0.3

Published

A lightweight and developer-friendly Node.js + TypeScript package for translating between English and major Nigerian languages — Igbo, Yoruba, and Hausa. Provides simple bidirectional translation functions (English ↔ Igbo, Yoruba, Hausa) powered by the Bi

Readme

🇳🇬 nigeria-translator

npm version license types downloads

A lightweight, developer-friendly TypeScript package for translating between English and major Nigerian languages (Igbo, Yoruba, and Hausa). Perfect for chatbots, APIs, learning apps, and automation workflows.

Created with ❤️ by Achu-ulim Agbama


✨ Features

  • 🔄 Bidirectional translation — English ↔ Igbo/Yoruba/Hausa
  • 📘 Full TypeScript support with type definitions
  • Zero configuration — works out of the box
  • 🪶 Lightweight with minimal dependencies
  • 🔁 Promise-based async API for modern workflows

📦 Installation

npm install nigeria-translator
# Or with yarn
yarn add nigeria-translator
# Or with pnpm
pnpm add nigeria-translator

🚀 Quick Start

const { englishToIgbo, igboToEnglish } = require('nigeria-translator');

async function translate() {
  const igbo = await englishToIgbo('Hello');
  console.log(igbo); // Output: Ndewo
  
  const english = await igboToEnglish('Ndewo');
  console.log(english); // Output: Hello
}

translate();

📖 Usage

JavaScript (CommonJS)

const {
  englishToIgbo,
  englishToYoruba,
  englishToHausa,
  igboToEnglish,
  yorubaToEnglish,
  hausaToEnglish
} = require('nigeria-translator');

async function examples() {
  // English to Nigerian languages
  console.log(await englishToIgbo('come'));        // → bia
  console.log(await englishToYoruba('how are you')); // → bawo ni
  console.log(await englishToHausa('food'));       // → abinci

  // Nigerian languages to English
  console.log(await igboToEnglish('bia'));         // → come
  console.log(await yorubaToEnglish('bawo ni'));   // → how are you
  console.log(await hausaToEnglish('abinci'));     // → food
}

examples();

TypeScript (ES Modules)

import {
  englishToIgbo,
  englishToYoruba,
  englishToHausa,
  igboToEnglish,
  yorubaToEnglish,
  hausaToEnglish
} from 'nigeria-translator';

async function main(): Promise<void> {
  const igbo = await englishToIgbo('friend');
  const yoruba = await englishToYoruba('house');
  const hausa = await englishToHausa('water');

  console.log(igbo);   // → enyi
  console.log(yoruba); // → ile
  console.log(hausa);  // → ruwa

  const translation = await igboToEnglish('anyị');
  console.log(translation); // → we/us
}

main();

Express.js API

import express from 'express';
import { englishToYoruba } from 'nigeria-translator';

const app = express();

app.get('/translate', async (req, res) => {
  try {
    const { text } = req.query;
    const translated = await englishToYoruba(text);
    res.json({ original: text, translated });
  } catch (error) {
    res.status(500).json({ error: 'Translation failed' });
  }
});

app.listen(3000, () => {
  console.log('🚀 Translation API running on http://localhost:3000');
});

NestJS Service

// translate.service.ts
import { Injectable } from '@nestjs/common';
import {
  englishToIgbo,
  englishToYoruba,
  englishToHausa
} from 'nigeria-translator';

@Injectable()
export class TranslateService {
  async translateToIgbo(text: string): Promise<string> {
    return englishToIgbo(text);
  }

  async translateToYoruba(text: string): Promise<string> {
    return englishToYoruba(text);
  }

  async translateToHausa(text: string): Promise<string> {
    return englishToHausa(text);
  }
}

📚 API Reference

English → Nigerian Languages

| Function | Description | Returns | |----------|-------------|---------| | englishToIgbo(text: string) | Translate English to Igbo | Promise<string> | | englishToYoruba(text: string) | Translate English to Yoruba | Promise<string> | | englishToHausa(text: string) | Translate English to Hausa | Promise<string> |

Nigerian Languages → English

| Function | Description | Returns | |----------|-------------|---------| | igboToEnglish(text: string) | Translate Igbo to English | Promise<string> | | yorubaToEnglish(text: string) | Translate Yoruba to English | Promise<string> | | hausaToEnglish(text: string) | Translate Hausa to English | Promise<string> |

Note: All functions are async and return Promises. Use await or .then() to handle the results.


🛠️ Use Cases

  • Chatbots — WhatsApp, Telegram, Discord bots with Nigerian language support
  • APIs — Add translation endpoints to your REST or GraphQL APIs
  • Learning Apps — Build language learning tools for Nigerian languages
  • Content Localization — Translate UI strings, notifications, and content
  • AI Assistants — Enhance voice and text assistants with local language support

🤝 Contributing

Contributions are welcome! If you'd like to improve this package:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

👨‍💻 Author

Achu-ulim Agbama
Software Engineer @ Nugitech
Made with passion for Nigerian culture and accessibility 🇳🇬

  • GitHub: https://github.com/Achufam24
  • Twitter: https://x.com/agbama_achu

📄 License

ISC License — Free for personal and commercial use.


🌟 Show Your Support

If this package helped you, please give it a ⭐ on GitHub!