New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

bnnum

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bnnum - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+37
-21
package.json
{
"name": "bnnum",
"version": "1.0.1",
"description": "Number conversion package from english to Bengali",
"main": "dist/index.js",
"directories": {
"test": "test"
},
"scripts": {
"build": "babel src -d dist",
"dev": "babel src -d dist --watch",
"test": "babel-node test/index"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0"
},
"dependencies": {
"bnnum": "^1.0.0"
}
"name": "bnnum",
"version": "1.0.2",
"description": "Number conversion package from english to Bengali",
"main": "dist/index.js",
"scripts": {
"build": "babel src -d dist",
"dev": "babel src -d dist --watch",
"test": "babel-node test/index"
},
"author": {
"name": "KingRayhan",
"url": "http://rayhan.info",
"email": "md.raihan095@northsouth.edu"
},
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0"
},
"dependencies": {
"bnnum": "^1.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kingRayhan/bnnum.git"
},
"keywords": [
"Bengali",
"translate",
"bangla",
"number-to-bengali",
"number-to-bangla"
],
"bugs": {
"url": "https://github.com/kingRayhan/bnnum/issues"
},
"homepage": "https://github.com/kingRayhan/bnnum#readme"
}

@@ -1,7 +0,14 @@

Translate number to `Bengali`
## Translate number to `Bengali`
**Installation**
```bash
npm install bnnum
```
**Example**
```js
import bnNum from "bnnum"
import bnNum from 'bnnum'
console.log(bnNum(4587))

@@ -13,1 +20,18 @@ // => ৪৫৮৭

```
**Parameters**
| Name | Data Type | Description |
| ----- | --------- | --------------------------------------------- |
| num | `int` | Number to convert in Bengali |
| komma | `boolean` | (**Default:**`true`) Komma notation on number |
**Returns**
```
@return {string} Translated bangla number
```
### Known Issue
This package will not works in backend

@@ -19,15 +19,15 @@ /**

const bnNum = (num, komma = false) => {
return `${num.toLocaleString("fullwide", { useGrouping: komma })}`
.replace("1", "১")
.replace("2", "২")
.replace("3", "৩")
.replace("4", "৪")
.replace("5", "৫")
.replace("6", "৬")
.replace("7", "৭")
.replace("8", "৮")
.replace("9", "৯")
.replace("0", "০")
return `${num.toLocaleString('fullwide', { useGrouping: komma })}`
.replace('1', '১')
.replace('2', '২')
.replace('3', '৩')
.replace('4', '৪')
.replace('5', '৫')
.replace('6', '৬')
.replace('7', '৭')
.replace('8', '৮')
.replace('9', '৯')
.replace('0', '০')
}
export default bnNum
// .babelrc
{
"presets": ["env"]
}