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

masonic-time

v1.0.2

Published

A Javascript date library for parsing, validating, manipulating, and formatting Masonic dates.

Downloads

14

Readme

masonic-time

A Javascript date library for parsing, validating, manipulating, and formatting Masonic dates.

Installation

Install via npm:

npm install masonic-time

Install via yarn:

yarn install masonic-time

Usage

Importing the library

import FMTime from 'masonic-time';

const fmTime = new FMTime();

Convert Gregorian Year to Masonic Calendar Years

console.log(fmTime.toAL(2024)); // 6024 (Anno Lucis)
console.log(fmTime.toAM(2024)); // 5784 (Anno Mundi)
console.log(fmTime.toAI(2024)); // 2554 (Anno Inventionis)
console.log(fmTime.toAdep(2024)); // 3024 (Anno Depositionis)
console.log(fmTime.toAO(2024)); // 906 (Anno Ordinis)
console.log(fmTime.toAB(2024)); // 3935 (Anno Benefacio)

Format Dates Using Masonic Calendar Systems

const date = new Date('2024-01-01');

console.log(fmTime.formatALDate(date)); // '1/1/6024'
console.log(fmTime.formatAMDate(date)); // '1/1/5784'
console.log(fmTime.formatAIDate(date)); // '1/1/2554'
console.log(fmTime.formatAdepDate(date)); // '1/1/3024'
console.log(fmTime.formatAODDate(date)); // '1/1/906'
console.log(fmTime.formatABDate(date)); // '1/1/3935'

Parse Dates Masonic Calendar Strings to Javascript Date


console.log(fmTime.parseALDate("1/1/6024 A.L")); // '1/1/2024'
console.log(fmTime.parseAMDate("1/1/5784 A.M")); // '1/1/2024'
console.log(fmTime.parseAIDate("1/1/2554 A.M")); // '1/1/2024'
console.log(fmTime.parseADepDate("1/1/3024 A.M")); // '1/1/2024'
console.log(fmTime.parseAODate("1/1/906 A.M")); // '1/1/2024'
console.log(fmTime.parseABDate("1/1/3935 A.M")); // '1/1/2024'

API Reference

Methods

| Method | Description | Example | |--------|-------------|---------| | toAL(year: number) | Converts Gregorian year to Anno Lucis (A.L.) | toAL(2024) → 6024 | | toAM(year: number) | Converts Gregorian year to Anno Mundi (A.M.) | toAM(2024) → 5784 | | toAI(year: number) | Converts Gregorian year to Anno Inventionis (A.I.) | toAI(2024) → 2554 | | toAdep(year: number) | Converts Gregorian year to Anno Depositionis (A.Dep.) | toAdep(2024) → 3024 | | toAO(year: number) | Converts Gregorian year to Anno Ordinis (A.O.) | toAO(2024) → 906 | | toAB(year: number) | Converts Gregorian year to Anno Benefacio (A.B.) | toAB(2024) → 3935 | | formatALDate(date: Date) | Formats a date in Anno Lucis (A.L.) | formatALDate(new Date()) | | formatAMDate(date: Date) | Formats a date in Anno Mundi (A.M.) | formatAMDate(new Date()) | | formatAIDate(date: Date) | Formats a date in Anno Inventionis (A.I.) | formatAIDate(new Date()) | | formatAdepDate(date: Date) | Formats a date in Anno Depositionis (A.Dep.) | formatAdepDate(new Date()) | | formatAODDate(date: Date) | Formats a date in Anno Ordinis (A.O.) | formatAODDate(new Date()) | | formatABDate(date: Date) | Formats a date in Anno Benefacio (A.B.) | formatABDate(new Date()) |

Tests

masonic-time follows a Test-Driven Development (TDD) approach using Jest.

Running Tests

To run tests, use the following command:

npm test

Jest will execute the test cases defined in tests to ensure all conversions and formatting methods work as expected.

TODO:

  • [X] Parsing (i.e., converting a formatted Masonic date back into a JavaScript Date object).
  • [] Validating (i.e., checking if a given Masonic date is valid).
  • [] Manipulating (i.e., adding/subtracting days, months, or years in Masonic time).

License

This package is licensed under the MIT License.