npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

achar-js

v0.5.1

Published

All the utility functions you'll need to build a fully functional e-commerce site

Readme

Achar

All the utility functions you'll need to build a fully functional e-commerce site
Created with :heart: and :coffee: by the Basalam developers

Version Badge Downloads Badge License Badge
Size Badge Stars Badge

Getting started

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

Basic usage

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

Usage

Here you can see an overview of the different utilities available and how they work

convertToSnakeCase

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"] }

generateUniqueId

Generates a unique id with the requested length

import { generateUniqueId } from "achar-js"

generateUniqueId(16) // fk5ghtmvlprt2zyn

isObject

Checks whether the input value is an object or not

import { isObject } from "achar-js"

isObject({}) // true
isObject([]) // false
isObject([]) // false

numberSeparator

Separates the inputted number

import { numberSeparat } from "achar-js"

numberSeparat(2000) // "2,000"
numberSeparat("2000") // "2,000"

rialToToman

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"

rialToHumanizeToman

Converts Rials to Tomans in a human-readable form

import { rialToHumanizeToman } from "achar-js"

rialToHumanizeToman(20000) // "2,000 تومان"

toEnglishDigits

Converts Arabic or Persian numbers to English

import { toEnglishDigits } from "achar-js"

toEnglishDigits("۴۰۰۰ بار سلام بر تو") // "4000 بار سلام بر تو"
toEnglishDigits("٤۰۰۰ تحية لكم") // "4000 تحياتي لكم"