Current Version: v0.6.0
Ranks in the Canadian Armed Forces mark a person's position in its hierarchical structure. As people gain more responsibility and authority, they earn promotions in rank.
This library enables the easy reusability of the Canadian Armed Forces Ranks within your own project.
This library is available using the Node Package Manager.
npm install caf-ranks
Depending on the environment you are using, importing the library will look a little different.
// CommonJS
const { allRanks } = require("caf-ranks");
// ModernJS
import { allRanks } from "caf-ranks";
import { allRanks } from "caf-ranks";
// Log all English ranks to the console
allRanks.forEach((rank) => {
console.log(rank.title.en);
});
/*
General
Admiral
Lieutenant-General
Vice-Admiral
Major-General
(...)
*/
// Log all French rank abberviations to the console
allRanks.forEach((rank) => {
console.log(rank.abbreviation.fr);
});
/*
gén
am
lgén
vam
mgén
(...)
*/
import {
allRanks,
filterRanksByCommand,
filterRanksByCategory,
} from "caf-ranks";
// Log all English Navy ranks to the console
const navyRanks = filterRanksByCommand(allRanks, "RCN");
navyRanks.forEach((rank) => {
console.log(rank.title.en);
});
/*
Admiral
Vice-Admiral
Rear-Admiral
Commodore
Captain(N)
(...)
*/
// Log all French Air Force NCM ranks to the console
const airForceRanks = filterRanksByCommand(allRanks, "RCAF");
const airForceNCMRanks = filterRanksByCategory(airForceRanks, "JuniorNCM");
airForceNCMRanks.forEach((rank) => {
console.log(rank.title.fr);
});
/*
Caporal-chef
Caporal
Aviateur (formé)
Aviateur (confirmé)
*/
import { rankMeta } from "caf-ranks";
// Log the English version of the Army element to the console
console.log(rankMeta.command.CA.en);
/*
Canadian Army
*/
// Log the French version of the Flag Officer category to the console
console.log(rankMeta.category.FlagOfficer.fr);
/*
Officiers généraux
*/
This project is licensed under the Open Government Licence - Canada 2.0
See LICENSE.md