New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gematriya

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gematriya

Convert numbers to gematriya representation, and vice-versa.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-2.77%
Maintainers
1
Weekly downloads
 
Created
Source

Gematriya

Gematriya/Gematria, or perhaps more accurately, Hebrew numerals, is a system of writing numbers as Hebrew letters. This JavaScript module allows for easy conversion between gematriya and JavaScript Number types.

This code was originally written for hebcal/hebcal-js.

Install

Install gematriya from NPM, bower, or just take the gematriya.js script from this repo.

npm install gematriya
bower install gematriya

API

On the client side, the API is available through the global function gematriya. In Node, require('gematriya').

A single function is available. Pass it a Number or String. Given a number, it will return the string representation. Given a gematriya string, it will return the number it represents.

When passing a string, by default, it just adds up the numbers, regardless of place. By passing true as a second parameter, it will treat it as being ordered, as per the output (see below).

When passing a number, a second parameter is available, limit. This will limit the length of the returned string to a number of digits. For example:

gematriya(5774) // התשע"ד - ordinary
gematriya(5774, 3) // תשע"ד - cropped to 774
gematriya(5774, 7) // התשע"ד - kept at 5774

License

Licensed MIT.

Keywords

FAQs

Package last updated on 20 Nov 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc