@lacspace/nepali-utils 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +45 -15
  2. package/README.md +40 -17
  3. package/package.json +15 -4
package/LICENSE CHANGED
@@ -1,21 +1,51 @@
1
- MIT License
1
+ Lacspace Free Licence
2
+ Version 1.0, August 2026
2
3
 
3
4
  Copyright (c) 2026 Lacspace
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
6
+ PREAMBLE
11
7
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
8
+ This software is published by Lacspace under the Lacspace Free Licence a free,
9
+ permissive licence that lets you use this software for any purpose, including in
10
+ commercial products and services, at no cost. It grants the same freedoms as
11
+ common permissive open-source licences; the only condition is that this notice
12
+ travels with the software. The canonical, always-current text of this licence is
13
+ maintained at https://lacspace.com/licenses/lacspace-free-1.0
14
+
15
+ GRANT OF RIGHTS
16
+
17
+ Permission is hereby granted, free of charge, to any person or organisation
18
+ obtaining a copy of this software and its associated documentation and data files
19
+ (the "Software"), to deal in the Software without restriction, including without
20
+ limitation the rights to use, copy, modify, merge, publish, distribute,
21
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the
22
+ Software is furnished to do so, subject to the conditions below. These rights are
23
+ granted for any purpose, personal or commercial, and are perpetual, worldwide,
24
+ non-exclusive, and royalty-free.
25
+
26
+ CONDITIONS
27
+
28
+ The above copyright notice, this permission notice, and the name of this licence
29
+ ("Lacspace Free Licence") shall be included in all copies or substantial portions
30
+ of the Software.
31
+
32
+ TRADEMARKS
33
+
34
+ This licence does not grant permission to use the trade names, trademarks, service
35
+ marks, logos, or product names of Lacspace, except as required to reproduce the
36
+ notice above or to describe the origin of the Software in a truthful manner.
37
+
38
+ DISCLAIMER OF WARRANTY AND LIMITATION OF LIABILITY
14
39
 
15
40
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
42
+ FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
43
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN
44
+ AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
45
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46
+
47
+ ---
48
+
49
+ The Lacspace Free Licence is a source-available, permissive licence and is not (as
50
+ of this version) an OSI-approved licence. In substance it grants the same freedoms
51
+ as the MIT Licence. Learn more at https://lacspace.com/licenses
package/README.md CHANGED
@@ -1,13 +1,30 @@
1
+ <div align="center">
2
+
1
3
  # @lacspace/nepali-utils
2
4
 
3
- [![npm](https://img.shields.io/npm/v/@lacspace/nepali-utils.svg)](https://www.npmjs.com/package/@lacspace/nepali-utils) [![license](https://img.shields.io/npm/l/@lacspace/nepali-utils.svg)](https://github.com/lacspace/npm-packages/blob/main/LICENSE)
5
+ **Everyday helpers for Nepal-facing apps — rupees, numerals, amount-in-words, validators, provinces.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@lacspace/nepali-utils?color=%23f59e0b&label=npm)](https://www.npmjs.com/package/@lacspace/nepali-utils)
8
+ [![install size](https://packagephobia.com/badge?p=@lacspace/nepali-utils)](https://packagephobia.com/result?p=@lacspace/nepali-utils)
9
+ [![minzipped](https://img.shields.io/bundlephobia/minzip/@lacspace/nepali-utils?label=minzip)](https://bundlephobia.com/package/@lacspace/nepali-utils)
10
+ [![types](https://img.shields.io/badge/types-included-blue)](https://www.npmjs.com/package/@lacspace/nepali-utils)
11
+ [![license](https://img.shields.io/npm/l/@lacspace/nepali-utils?color=green)](https://github.com/lacspace/npm-packages/blob/main/LICENSE)
12
+
13
+ </div>
14
+
15
+ > The little things every Nepali app re-implements — done once, done right.
4
16
 
5
- Everyday helpers for building Nepal-facing apps: NPR currency formatting with the South-Asian (lakh/crore) grouping, Devanagari numerals, amount-in-words for invoices, common validators, and province data. Zero dependencies, isomorphic, fully typed.
17
+ - 💰 NPR formatting with **lakh/crore** grouping
18
+ - 🔢 Devanagari ↔ Arabic numerals
19
+ - 🧾 Amount-in-words for invoices
20
+ - ✅ Phone / PAN validators
21
+ - 🗺️ The 7 federal provinces
22
+ - ⚡ Zero dependencies · 🌍 isomorphic · 📦 ESM + CJS · fully typed
6
23
 
7
24
  ## Install
8
25
 
9
26
  ```bash
10
- npm install @lacspace/nepali-utils
27
+ npm install @lacspace/nepali-utils # or pnpm add / yarn add / bun add
11
28
  ```
12
29
 
13
30
  ## Currency & numbers
@@ -15,13 +32,13 @@ npm install @lacspace/nepali-utils
15
32
  ```ts
16
33
  import { formatNPR, groupNepali, toDevanagari, fromDevanagari } from "@lacspace/nepali-utils";
17
34
 
18
- formatNPR(1234567.5); // "Rs. 12,34,567.50"
19
- formatNPR(1234567.5, { symbol: "रू " , devanagari: true }); // "रू १२,३४,५६७.५०"
20
- formatNPR(50000, { decimals: 0, symbol: "" }); // "50,000"
35
+ formatNPR(1234567.5); // "Rs. 12,34,567.50"
36
+ formatNPR(1234567.5, { symbol: "रू ", devanagari: true }); // "रू १२,३४,५६७.५०"
37
+ formatNPR(50000, { decimals: 0, symbol: "" }); // "50,000"
21
38
 
22
- groupNepali(1234567); // "12,34,567" (South-Asian grouping)
23
- toDevanagari("2081"); // "२०८१"
24
- fromDevanagari("२०८१"); // "2081"
39
+ groupNepali(1234567); // "12,34,567" (South-Asian grouping)
40
+ toDevanagari("2081"); // "२०८१"
41
+ fromDevanagari("२०८१"); // "2081"
25
42
  ```
26
43
 
27
44
  ## Amount in words (for invoices)
@@ -44,7 +61,6 @@ import { isValidNepaliMobile, isValidPAN } from "@lacspace/nepali-utils";
44
61
  isValidNepaliMobile("9812345678"); // true
45
62
  isValidNepaliMobile("+9779812345678"); // true
46
63
  isValidNepaliMobile("1234567890"); // false
47
-
48
64
  isValidPAN("123456789"); // true (9 digits)
49
65
  ```
50
66
 
@@ -61,14 +77,21 @@ PROVINCES[2];
61
77
 
62
78
  | Function | Description |
63
79
  | --- | --- |
64
- | `formatNPR(amount, opts?)` | NPR currency string; opts: `symbol`, `decimals`, `devanagari` |
80
+ | `formatNPR(amount, opts?)` | NPR string · opts: `symbol`, `decimals`, `devanagari` |
65
81
  | `groupNepali(value)` | South-Asian digit grouping |
66
- | `toDevanagari(x)` / `fromDevanagari(x)` | numeral conversion |
67
- | `numberToWords(n)` | South-Asian words (Lakh/Crore/Arab) |
68
- | `amountInWords(n)` | "Rupees … only" wrapper |
69
- | `isValidNepaliMobile(s)` / `isValidPAN(s)` | validators |
82
+ | `toDevanagari` / `fromDevanagari` | numeral conversion |
83
+ | `numberToWords(n)` | words with Lakh / Crore / Arab |
84
+ | `amountInWords(n)` | "Rupees … Only" wrapper |
85
+ | `isValidNepaliMobile` / `isValidPAN` | validators |
70
86
  | `PROVINCES` | the 7 federal provinces |
71
87
 
72
- ## License
88
+ ## The Lacspace family
89
+
90
+ | Package | For |
91
+ | --- | --- |
92
+ | [`@lacspace/nepali-date`](https://www.npmjs.com/package/@lacspace/nepali-date) | Bikram Sambat dates |
93
+ | **`@lacspace/nepali-utils`** | Nepal helpers (this package) |
94
+ | [`@lacspace/sdk`](https://www.npmjs.com/package/@lacspace/sdk) | Full Lacspace platform SDK |
95
+ | [`@lacspace/react`](https://www.npmjs.com/package/@lacspace/react) | React hooks |
73
96
 
74
- MIT © [Lacspace](https://lacspace.com)
97
+ <div align="center"><sub>Built with care by <a href="https://lacspace.com">Lacspace</a> · Lacspace Free Licence · <a href="https://github.com/lacspace/npm-packages">source</a></sub></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacspace/nepali-utils",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Everyday Nepal helpers — NPR currency formatting, Devanagari numerals, amount-in-words, validators, provinces. Zero-dependency.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -18,15 +18,26 @@
18
18
  }
19
19
  }
20
20
  },
21
- "files": ["dist"],
21
+ "files": [
22
+ "dist"
23
+ ],
22
24
  "sideEffects": false,
23
25
  "scripts": {
24
26
  "build": "tsup",
25
27
  "prepublishOnly": "npm run build"
26
28
  },
27
- "keywords": ["nepal", "nepali", "npr", "currency", "devanagari", "amount-in-words", "validator", "typescript"],
29
+ "keywords": [
30
+ "nepal",
31
+ "nepali",
32
+ "npr",
33
+ "currency",
34
+ "devanagari",
35
+ "amount-in-words",
36
+ "validator",
37
+ "typescript"
38
+ ],
28
39
  "author": "Lacspace <contact@lacspace.com>",
29
- "license": "MIT",
40
+ "license": "SEE LICENSE IN LICENSE",
30
41
  "homepage": "https://lacspace.com",
31
42
  "repository": {
32
43
  "type": "git",