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

@almaiura/legal-deadline-calculator

v0.1.0

Published

Italian legal deadline calculator with civil procedural rules, holidays and ferial/covid suspensions.

Readme

@almaiura/legal-deadline-calculator

TypeScript calculator for Italian civil procedural deadlines.

Handles:

  • day and week terms, with the dies a quo excluded;
  • free day terms, with both the dies a quo and the dies ad quem excluded;
  • month and year terms ex nominatione dierum;
  • historical summer judicial suspension: until 2014 01/08–15/09, from 2015 01/08–31/08;
  • extraordinary Covid-19 civil suspension 09/03/2020–11/05/2020;
  • Italian national holidays and Easter Monday;
  • optional local holidays;
  • forward roll pursuant to art. 155 Italian Code of Civil Procedure;
  • prudential backward calculation, moving back to the previous business day when the date falls on a Saturday, Sunday, or holiday.

Note: this package implements general rules and must be validated against the specific use case. The summer suspension does not apply to all proceedings.

Installation

npm install @almaiura/legal-deadline-calculator

Basic usage

import { calculateDeadline } from "@almaiura/legal-deadline-calculator";

const result = calculateDeadline({
    startDate: "2026-07-20",
    amount: 30,
    unit: "days",
    direction: "forward",
    suspensions: true,
    roll: "procedural",
});

console.log(result.dueDate);
console.log(result.adjustments);

Examples

Saturday roll under art. 155 c.p.c.

calculateDeadline({
    startDate: "2016-12-04",
    amount: 20,
    unit: "days",
    direction: "forward",
}).dueDate;
// => "2016-12-27"

Holiday Friday: Saturday allowed if not itself a holiday

calculateDeadline({
    startDate: "2013-10-02",
    amount: 30,
    unit: "days",
    direction: "forward",
}).dueDate;
// => "2013-11-02"

Prudential backward deadline

calculateDeadline({
    startDate: "2013-11-13",
    amount: 10,
    unit: "days",
    direction: "backward",
}).dueDate;
// => "2013-10-31"

Summer suspension before 2015

calculateDeadline({
    startDate: "2013-07-12",
    amount: 20,
    unit: "days",
    suspensions: true,
    includeCovid2020: false,
}).dueDate;
// => "2013-09-16"

Local holiday

calculateDeadline({
    startDate: "2026-06-28",
    amount: 1,
    unit: "days",
    extraHolidays: [{ date: "2026-06-29", name: "Saints Peter and Paul - Rome" }],
}).dueDate;

API

type DeadlineUnit = "days" | "weeks" | "months" | "years";
type DeadlineDirection = "forward" | "backward";
type DeadlineRoll = "procedural" | "generic" | "none";

interface CalculateDeadlineInput {
    startDate: string; // YYYY-MM-DD
    amount: number;
    unit?: DeadlineUnit;
    direction?: DeadlineDirection;
    freeTerm?: boolean;
    suspensions?: boolean;
    includeCovid2020?: boolean;
    extraSuspensionIntervals?: { start: string; end: string; reason?: string }[];
    extraHolidays?: { date: string; name: string }[];
    roll?: DeadlineRoll;
}

roll: "procedural" replicates the prudential behaviour best suited for civil procedural deadlines:

  • forward: Sundays and national/local holidays roll to the next non-holiday day;
  • forward: if the calculated date falls exactly on a Saturday, it rolls to the next non-holiday day;
  • forward: if the calculated date falls on a holiday Friday, the following Saturday may be valid if it is not itself a holiday;
  • backward: Saturdays, Sundays, and holidays move back to the previous business day.

Build and test

npm install
npm test

npm publishing

npm version patch
npm publish --access public

For a private scoped package, use your organisation's npm configuration.