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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lezgi-numbers

v1.1.0

Published

Convert numbers to Lezgi numerals in your Node.js project or in browser using this ts/js library

Downloads

10

Readme

Lezgi Numbers

This TypeScript library provides functions for:

  • converting numbers to Lezgi numerals (numToLezgi)
  • converting Lezgi numerals to numbers (lezgiToNum)
  • generate basic TTS (Text-to-Speech) in Lezgi language for the given number using playLezgiNumberTts - it plays generated audio in the browser

Note: Currently only integers are supported.

It can be used in both Node.js and browser environments.

For the best results, choose the numbers between Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER which are equal to -9007199254740991 and 9007199254740991 respectively.

  • lib directory contains the compiled JavaScript code with the type definitions.
  • dist directory contains the compiled minified JavaScript file ready for use in browser environments.

Installation

Node.js

npm i lezgi-numbers

Browser

<script src="https://unpkg.com/[email protected]/dist/lezgi-numbers.js"></script>

Usage

Node.js

Import package like:

const { numToLezgi, lezgiToNum, playLezgiNumberTts } = require('lezgi-numbers');

Or

import { numToLezgi, lezgiToNum, playLezgiNumberTts } from 'lezgi-numbers';

And then use it:

console.log(numToLezgi(1986)); // 'агъзурни кIуьд вишни кьудкъанни ругуд'
console.log(lezgiToNum('кьве агъзурни къанни кьуд')); // 2024
// Function below will work only if run in browser.
// So it should be used either in SPA or if in SSR, it should be used in the client side.
playLezgiNumberTts(1986, '<path/to/mp3/files>'); // Audio of pronounced 'агъзурни кIуьд вишни кьудкъанни ругуд'

Browser

<script src="https://unpkg.com/[email protected]/dist/lezgi-numbers.js"></script>
<script>
  try {
    // Convert numbers to Lezgi numerals
    alert(LezgiNumbers.numToLezgi(1986)); // 'агъзурни кIуьд вишни кьудкъанни ругуд'
    // Convert Lezgi numerals to numbers
    alert(LezgiNumbers.lezgiToNum('кьве агъзурни къанни кьуд')); // 2024
    // Play the audio of pronounced Lezgi numerals
    LezgiNumbers.playLezgiNumberTts(1986, '<path/to/mp3/files>'); // Audio of pronounced 'агъзурни кIуьд вишни кьудкъанни ругуд' will be played
  } catch (e) {
    alert(e.message);
  }
</script>

Path to mp3 files

You can provide the path to the mp3 files for the TTS. The mp3 files are located in the mp3 directory in the root of the package. If you want to use your own mp3 files, you can provide the path to your mp3 files.

Here is the structure of the mp3 directory:

mp3
├── ' .mp3'
├── 'цIе.mp3'
├── 'цIу.mp3'
├── 'цIи.mp3'
├── 'ни.mp3'
├── 'рид.mp3'
├── 'къанни.mp3'
├── 'кьве.mp3'
├── 'минус.mp3'
├── 'нул.mp3'
├── 'сад.mp3'
├── 'кьвед.mp3'
├── 'пуд.mp3'
├── 'кьуд.mp3'
├── 'вад.mp3'
├── 'ругуд.mp3'
├── 'ирид.mp3'
├── 'муьжуьд.mp3'
├── 'кIуьд.mp3'
├── 'цIуд.mp3'
├── 'къад.mp3'
├── 'яхцIур.mp3'
├── 'виш.mp3'
├── 'агъзур.mp3'
├── 'миллион.mp3'
├── 'миллиард.mp3'
├── 'триллион.mp3'
├── 'квадриллион.mp3'
├── 'квинтиллион.mp3'
├── 'секстиллион.mp3'
├── 'септиллион.mp3'
├── 'октиллион.mp3'
├── 'нониллион.mp3'