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

airac-cc

v1.0.6

Published

Utility for AIRAC cycle calculations

Downloads

137

Readme

airac-cc (AIRAC cycle calculator)

Build Status Coverage Status Issues NPM Version NPM License

This module can be used to calculate Aeronautical Information Regulation And Control (AIRAC) cycle identifiers and effectivity dates as defined by the International Civil Aviation Organization (ICAO). A list of current AIRAC cycle effectivity dates can be found here.

The code of this module is based on a similar Java library written by Johannes Kohnen.

Usage

const airac = require("airac-cc");
let cycle;
try {
    cycle = airac.Cycle.fromIdentifier("1909");
    console.log(cycle.effectiveStart);
    console.log(cycle.effectiveEnd);
} catch (error) {
    if (error instanceof airac.InvalidCycleIdentifierError) {
        // ...
    }
}
cycle = airac.Cycle.fromDate(new Date());
console.log(cycle.identifier);
console.log(cycle.effectiveStart);
console.log(cycle.effectiveEnd);

Note: when using the fromIdentifier method, this module will only consider AIRAC cycle identifiers between January 1st 1980 and December 31st 2079. Therefore, cycle 7501 will be considred to be the first cycle of 2075, not 1975! If you want to calculate effectifity dates outside of this range, use the fromDate method.

This module comes with TypeScript definitions. The TypeScript version of the code above:

import { Cycle, InvalidCycleIdentifierError } from "airac-cc";
let cycle;
try {
    cycle = Cycle.fromIdentifier("1909");
    console.log(cycle.effectiveStart);
    console.log(cycle.effectiveEnd);
} catch (error) {
    if (error instanceof InvalidCycleIdentifierError) {
        // ...
    }
}
cycle = Cycle.fromDate(new Date());
console.log(cycle.identifier);
console.log(cycle.effectiveStart);
console.log(cycle.effectiveEnd);

CLI

The AIRAC cycle calculator also comes with a CLI. Install it globally via

npm install -g airac-cc

This will install the command airac-cc globally on your system.

Print out the AIRAC cycle identifier and the corresponding effectivity dates of the currently effective AIRAC cycle to the console:

airac-cc

Print out the AIRAC cycle identifier and the corresponding effectivity dates for a specific AIRAC cycle (identified by the given cycle identifier):

airac-cc -i 1909

Note: when using the -i option, this module will only consider AIRAC cycle identifiers between January 1st 1980 and December 31st 2079. Therefore, cycle 7501 will be considred to be the first cycle of 2075, not 1975! If you want to calculate effectifity dates outside of this range, use the -d option (see below).

Print out the AIRAC cycle identifier and the corresponding effectivity dates for the cycle that's effective on a specific date (specify the date in ISO format):

airac-cc -d 2019-08-15

Print the help for the module:

airac-cc -h