
Security News
Lovable’s OJ Rewrites Vite’s Dev Server in Rust as AI Lowers the Cost of Forking Open Source
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.
nepali-units-pro-max
Advanced tools
नेपाली एकाइ — Nepali traditional units (ropani, aana, paisa, dam, bigha, kattha, dhur) plus standard length / weight / area / volume / temperature. Compound notation parser/formatter (`5 ropani 3 aana 2 paisa` ↔ m²), bilingual lookups, Devanagari digit su
Traditional Nepali land units (ropani, aana, paisa, dam, bigha, kattha, dhur) plus standard length / weight / area / volume / temperature. Compound notation parser/formatter (5 ropani 3 aana 2 paisa ↔ m²), bilingual lookups, Devanagari digit support.
"5 ropani 3 aana 2 paisa" and format m² back into compound formgetUnit("ropani"), getUnit("रोपनी"), getUnit("Bigha"), getUnit("कठ्ठा") all just workparseUnit("५.२५ रोपनी") works out of the boxtoBase)npm install nepali-units-pro-max
pnpm add nepali-units-pro-max
yarn add nepali-units-pro-max
bun add nepali-units-pro-max
import {
convert,
parseCompound,
formatCompound,
ropaniToM2,
m2ToBigha,
formatUnit,
} from "nepali-units-pro-max";
// Direct conversion (auto-category, bilingual)
convert(1, "ropani", "m2"); // 508.74
convert(1, "बिघा", "वर्ग मिटर"); // 6772.63
convert(100, "c", "f"); // 212
// Direct land helpers (hot path)
ropaniToM2(2.5); // 1271.85
m2ToBigha(13545.26); // 2.0
// Compound notation (the headline)
parseCompound("5 ropani 3 aana 2 paisa").m2; // ~2654.99
parseCompound("१ बिघा १० कठ्ठा").m2; // ~10158.95
formatCompound(2654.99); // "5 Ropani 3 Aana 2 Paisa"
formatCompound(10158.95, { system: "terai", locale: "ne" });
// "१ बिघा १० कठ्ठा"
// Display
formatUnit(5.25, "ropani", { locale: "ne" }); // "5.25 रोपनी"
| Rule | Why |
|---|---|
| Hill system: 1 ropani = 16 aana = 64 paisa = 256 dam (= 508.74 m²) | Used in Kathmandu valley + hill regions. |
| Terai system: 1 bigha = 20 kattha = 400 dhur (= 6772.63 m²) | Used in southern plains. |
convert(value, from, to) auto-detects category and rejects cross-category. | Saves you from convertUnit(v, "area", ...) boilerplate. |
parseCompound("5 ropani 3 aana") always returns m2. | m² is the only meaningful base for compound land notation. |
formatCompound(m2) defaults to hill system. | Most apps targeting Kathmandu / hill region just want this. Pass { system: "terai" } for plains. |
| Bilingual lookup is case- and diacritic-tolerant. | "Ropani", "ropani", "रोपनी", "ropani." all match. |
| Temperature uses formulas, not factors. | Celsius / Fahrenheit / Kelvin can't be multiplied to a common base. |
| Unit | m² | Devanagari | Sub-units |
|---|---|---|---|
| Ropani | 508.74 | रोपनी | 16 aana |
| Aana | 31.79625 | आना | 4 paisa |
| Paisa | 7.9490625 | पैसा | 4 dam |
| Dam | 1.987265625 | दाम | — |
| Unit | m² | Devanagari | Sub-units |
|---|---|---|---|
| Bigha | 6772.63 | बिघा | 20 kattha |
| Kattha | 338.6315 | कठ्ठा | 20 dhur |
| Dhur | 16.931575 | धुर | — |
Cross-system: 1 bigha ≈ 13.31 ropani.
The headline feature. Real-world Nepal real-estate listings often look like:
"5 ropani 3 aana 2 paisa 1 dam" (hill)"1 bigha 5 kattha 10 dhur" (Terai)// Parse
parseCompound("5 ropani 3 aana 2 paisa");
// {
// m2: 2654.99,
// system: "hill",
// parts: [
// { value: 5, key: "ropani" },
// { value: 3, key: "aana" },
// { value: 2, key: "paisa" },
// ],
// raw: "5 ropani 3 aana 2 paisa",
// }
parseCompound("१ बिघा १० कठ्ठा"); // Devanagari works
parseCompound("2.5 ropani"); // decimals work
parseCompound("1 ropani 2 kattha"); // mixed system flagged
// Format (m² → compound)
formatCompound(2654.99); // "5 Ropani 3 Aana 2 Paisa"
formatCompound(2654.99, { locale: "ne" }); // "५ रोपनी ३ आना २ पैसा"
formatCompound(10158.95, { system: "terai" }); // "1 Bigha 5 Kattha 10 Dhur"
formatCompound(508.74 * 5); // "5 Ropani" (zero segments skipped)
formatCompound always picks maximal sub-units — i.e., as many ropani as fit, then aana, then paisa, then dam. The smallest sub-unit absorbs any fractional remainder.
| Function | Description |
|---|---|
convert(value, from, to) | Auto-category, bilingual. Throws on unknown / cross-category. |
convertUnit(value, category, fromKey, toKey) | Low-level. Returns NaN on unknown. |
ropaniToM2 / m2ToRopani | Direct hot-path |
aanaToM2 / m2ToAana | |
paisaToM2 / m2ToPaisa | |
damToM2 / m2ToDam | |
bighaToM2 / m2ToBigha | |
katthaToM2 / m2ToKattha | |
dhurToM2 / m2ToDhur | |
bighaToRopani / ropaniToBigha | Cross-system |
| Function | Description |
|---|---|
getUnit(query) | By key / English / Devanagari / alias |
getCategoryOf(query) | "length" | "weight" | "area" | "volume" | "temperature" |
getUnitsForCategory(category) | All units in a category |
getCategories() | All 5 categories |
getTraditionalNepaliUnits() | The 7 hill + Terai area units |
| Function | Description |
|---|---|
parseUnit("5 ropani") | Single unit: { value, key } or null |
parseCompound("5 ropani 3 aana") | Compound notation: { m2, system, parts } or null |
safeParseUnit / safeParseCompound | Soft variants |
isValidUnitInput(s) | Boolean |
| Function | Description |
|---|---|
formatCompound(m2, opts?) | m² → "5 Ropani 3 Aana 2 Paisa" |
formatUnit(value, unitQuery, opts?) | "5.25 Ropani" |
formatConvertedValue(value) | Magnitude-aware precision, trailing-zero trim |
ROPANI_TO_M2, AANA_TO_M2, PAISA_TO_M2, DAM_TO_M2, BIGHA_TO_M2, KATTHA_TO_M2, DHUR_TO_M2, HILL_SYSTEM_KEYS, TERAI_SYSTEM_KEYS, LENGTH_UNITS, WEIGHT_UNITS, AREA_UNITS, VOLUME_UNITS, TEMPERATURE_UNITS, CATEGORY_LABELS.
import { parseCompound, formatCompound } from "nepali-units-pro-max";
const userInput = "5 ropani 3 aana 2 paisa";
const parsed = parseCompound(userInput);
if (parsed) {
console.log(`Total: ${parsed.m2.toFixed(2)} m²`);
// Save canonical m² to the database; reformat for display in any system.
console.log(`In Terai notation: ${formatCompound(parsed.m2, { system: "terai" })}`);
}
import { ropaniToM2, formatUnit } from "nepali-units-pro-max";
const m2 = ropaniToM2(5);
console.log(formatUnit(5, "ropani")); // "5 Ropani"
console.log(formatUnit(5, "ropani", { locale: "ne" })); // "5 रोपनी"
console.log(formatUnit(m2, "m2")); // "2543.7 Square metre"
import { convert } from "nepali-units-pro-max";
convert(36.5, "c", "f"); // 97.7 (body temperature)
convert(0, "c", "k"); // 273.15
convert(100, "f", "c"); // 37.778
import { getUnit, getCategoryOf, convert } from "nepali-units-pro-max";
function safeConvert(value: number, from: string, to: string) {
const fromUnit = getUnit(from);
const toUnit = getUnit(to);
if (!fromUnit || !toUnit) return null;
if (getCategoryOf(from) !== getCategoryOf(to)) return null;
return convert(value, from, to);
}
safeConvert(5, "रोपनी", "बिघा"); // ~0.376
PRs welcome. Common contributions:
"1.5 बिघा", mixed-script inputs)npm install
npm test
npm run typecheck
npm run build
MIT © 2026 l3lackcurtains
Made with ❤️ for the Nepali developer community.
बनाइएको नेपाली डेभलपर समुदायको लागि।
FAQs
नेपाली एकाइ — Nepali traditional units (ropani, aana, paisa, dam, bigha, kattha, dhur) plus standard length / weight / area / volume / temperature. Compound notation parser/formatter (`5 ropani 3 aana 2 paisa` ↔ m²), bilingual lookups, Devanagari digit su
We found that nepali-units-pro-max demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.