UNPKG

bhashantarh

Version:

Tiny translation wrapper with fallbacks (LibreTranslate -> MyMemory) and detection with franc fallback.

53 lines (33 loc) โ€ข 1.08 kB
# ๐ŸŒ bhashantarh A simple, lightweight NPM package to detect and translate text between languages using [LibreTranslate](https://libretranslate.de/). Perfect for use in **web apps, browser extensions, Node.js apps, and React projects**. --- ## โœจ Features - ๐ŸŒ Detect the language of any input text - ๐Ÿ” Translate between supported languages - ๐Ÿง  Uses free public translation API (LibreTranslate) - โšก Easy to integrate in any project --- ## ๐Ÿ“ฆ Installation ```bash npm install bhashantarh ``` --- ## ๐Ÿš€ Usage ```js const { detectLanguage, translate, getSupportedLanguages } = require("bhashantarh"); (async () => { const lang = await detectLanguage("Bonjour"); console.log("Detected:", lang); // fr const output = await translate("Hello", "en", "hi"); console.log("Translated:", output); // เคจเคฎเคธเฅเคคเฅ‡ console.log(getSupportedLanguages()); })(); ``` --- ## ๐ŸŒ Supported Languages Includes major global languages like: - English, Hindi, Urdu, Arabic, Chinese, Russian, Tamil, Telugu, etc. --- ## ๐Ÿ“„ License MIT License