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

@leelaing/gematria

v0.3.0

Published

Reusable, zero-runtime-dependency gematria calculation library for TypeScript and JavaScript.

Downloads

424

Readme

@leelaing/gematria

Reusable gematria calculations for TypeScript and JavaScript with zero runtime dependencies.

Install

npm install @leelaing/gematria

Basic usage

import { calculateGematria } from '@leelaing/gematria';

const result = calculateGematria('In the beginning', 'english-ordinal');

console.log(result.total);
console.log(result.letters);

Calculate every registered cipher

import { calculateAllGematria } from '@leelaing/gematria';

const results = calculateAllGematria('In the beginning');

for (const result of results) {
  console.log(result.system.name, result.total);
}

If only totals are needed:

import { calculateGematriaTotals } from '@leelaing/gematria';

const totals = calculateGematriaTotals('In the beginning');
console.log(totals['english-ordinal']);

Built-in systems

| ID | Name | Mapping | | ------------------------ | ---------------------- | ----------------------------------------------------------------- | | english-ordinal | English Ordinal | A=1 ... Z=26 | | full-reduction | Full Reduction | Ordinal reduced per letter to 1-9 | | reverse-ordinal | Reverse Ordinal | A=26 ... Z=1 | | reverse-full-reduction | Reverse Full Reduction | Reverse ordinal reduced per letter to 1-9 | | sumerian | Sumerian | Ordinal x 6 | | reverse-sumerian | Reverse Sumerian | Reverse ordinal x 6 | | english-extended | English Extended | A-I=1-9, J-R=10-90, S-Z=100-800 | | francis-bacon | Francis Bacon | 24-letter ordinal; I/J and U/V share values | | satanic | Satanic | A=36 ... Z=61 | | agrippa | Agrippa | Historical Latin/Agrippa values adapted to modern English letters | | latin-tiered | Latin Tiered | Modern 26-letter tiered A-Z mapping | | gematrix-jewish | Gematrix Jewish | Gematrix English-letter cipher; J=600, V=700, W=900 | | hebrew-gematria | Hebrew Gematria | Standard absolute values; final forms retain ordinary values | | greek-isopsephy | Greek Isopsephy | Greek alphabetic numerals, including 6, 90, and 900 letters |

Gematrix Jewish versus Hebrew Gematria

gematrix-jewish is the English-letter cipher used by Gematrix. It is not the native-script hebrew-gematria system. They remain separate so an English compatibility calculation cannot silently replace Hebrew-script Gematria.

calculateGematria('simple', 'gematrix-jewish').total; // 214
calculateGematria('שלום', 'hebrew-gematria').total; // 376

Hebrew and Greek

Both systems accept native-script text directly:

calculateGematria('שלום', 'hebrew-gematria').total; // 376
calculateGematria('ΙΗΣΟΥΣ', 'greek-isopsephy').total; // 888

Hebrew vowel points and Greek diacritics are ignored. Hebrew final forms use the same values as their ordinary forms. Greek final sigma is treated as sigma; stigma/digamma, koppa, and sampi are supported as 6, 90, and 900.

Agrippa versus modern tiered mappings

These are intentionally separate. Historical Agrippa-style Latin values place J, V, and W in special high-value positions. Many modern calculators instead use a straight 26-letter units/tens/hundreds progression. Keeping both systems distinct prevents one convention from silently masquerading as the other.

Detailed result

const result = calculateGematria('Love', 'english-ordinal');

Returns an object shaped like:

{
  text: "Love",
  normalizedText: "LOVE",
  system: { /* cipher definition */ },
  total: 54,
  letters: [
    { character: "L", normalized: "L", value: 12, index: 0 },
    { character: "o", normalized: "O", value: 15, index: 1 },
    { character: "v", normalized: "V", value: 22, index: 2 },
    { character: "e", normalized: "E", value: 5, index: 3 }
  ],
  countedCharacters: 4,
  ignoredCharacters: 0
}

Digits

Digits are ignored by default. They can optionally contribute their numeric value:

calculateGematria('ABC 123', 'english-ordinal', {
  includeDigits: true
});

Custom systems

import { calculateGematria, registerGematriaSystem } from '@leelaing/gematria';

registerGematriaSystem({
  id: 'lee-custom',
  name: 'Lee Custom',
  description: 'Example custom cipher',
  aliases: ['lc'],
  values: {
    A: 1,
    B: 10,
    C: 100
  }
});

console.log(calculateGematria('ABC', 'lee-custom').total); // 111
console.log(calculateGematria('ABC', 'lc').total); // 111

Registry API

import {
  getGematriaSystem,
  listGematriaSystems,
  registerGematriaSystem,
  requireGematriaSystem,
  unregisterGematriaSystem
} from '@leelaing/gematria';

The built-in ciphers are registered automatically when the package is imported.

Normalization

Input is case-insensitive where the script has case. Diacritics are decomposed before lookup, so cafe and café calculate identically under English systems, pointed Hebrew is accepted, and accented Greek maps to its base letters. Spaces and punctuation do not contribute to the value.

Development

npm install
npm run check

npm run check performs:

  1. TypeScript type checking
  2. Unit tests
  3. ESM and CommonJS builds
  4. A public export-contract test against both built distributions

That final test is deliberate: it catches functions that exist in src/ but accidentally disappear from the published package API.

License

MIT