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

achar-js

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

achar-js

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

latest
npmnpm
Version
0.5.1
Version published
Maintainers
3
Created
Source

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 تحياتي لكم"

Keywords

basalam

FAQs

Package last updated on 30 Jan 2023

Did you know?

Socket

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.

Install

Related posts