
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
All the utility functions you'll need to build a fully functional e-commerce site
Created with :heart: and :coffee: by the Basalam developers
Achar is an open-source, free project developed by the Basalam developers. You can use the achar-js package in your e-commerce project by installing it from npm
$ npm install achar-js // Or $ npm install --save achar-js for npm < 5.0.0
Or
$ yarn add achar-js
You can use achar-js like any other JavaScript package.
// Full Import
import * as achar from "achar-js"
achar.rialToToman(20000, { currencry: true, separator: true }) // تومان 2,000
// Import multiple utilities
import { rialToToman, isObject } from "achar-js"
isObject({}) // true
rialToToman(20000, { currencry: true, separator: true }) // تومان 2,000
// Single use (Default Exported)
import rialToToman from "achar-js/rialToToman"
rialToToman(20000, { currencry: true, separator: true }) // تومان 2,000
Here you can see an overview of the different utilities available and how they work
Converts snake_case words to camelCase
import { convertToSnakeCase } from "achar-js"
convertToSnakeCase("message_status") // messageStatus
It's also works with javascript objects or arrays
convertToSnakeCase({ message_status: "dont_touch", items: ["camel_me"] }) // { messageStatus: "dont_touch", items: ["camelMe"] }
Generates a unique id with the requested length
import { generateUniqueId } from "achar-js"
generateUniqueId(16) // fk5ghtmvlprt2zyn
Checks whether the input value is an object or not
import { isObject } from "achar-js"
isObject({}) // true
isObject([]) // false
isObject([]) // false
Separates the inputted number
import { numberSeparat } from "achar-js"
numberSeparat(2000) // "2,000"
numberSeparat("2000") // "2,000"
Converts Rials to Tomans
import { rialToToman } from "achar-js"
rialToToman(20000) // 2000
rialToToman("20000") // "2000"
rialToToman("20000", { currency: true }) // "2000 تومان"
rialToToman("20000", { separator: true }) // "2,000"
Converts Rials to Tomans in a human-readable form
import { rialToHumanizeToman } from "achar-js"
rialToHumanizeToman(20000) // "2,000 تومان"
Converts Arabic or Persian numbers to English
import { toEnglishDigits } from "achar-js"
toEnglishDigits("۴۰۰۰ بار سلام بر تو") // "4000 بار سلام بر تو"
toEnglishDigits("٤۰۰۰ تحية لكم") // "4000 تحياتي لكم"
FAQs
All the utility functions you'll need to build a fully functional e-commerce site
We found that achar-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.