benhovinga / caf-ranks

Complete list of the Canadian Armed Forces rank structure in JSON format (bilingual)
https://www.npmjs.com/package/caf-ranks
Other
0 stars 0 forks source link

Create install and usage docs #5

Closed benhovinga closed 5 days ago

benhovinga commented 1 week ago

Create install and usage docs. Here is a basic setup.

Install

npm install @benhovinga/caf-ranks

Usage

Modern JS (ES6 modules)

import cafRanks from '@benhovinga/caf-ranks';

cafRanks.forEach((rank) => {
  console.log(rank.title.en);
});

Common JS (Node.js)

const cafRanks = require('@benhovinga/caf-ranks');

cafRanks.forEach((rank) => {
  console.log(rank.title.en);
});
benhovinga commented 6 days ago

Previous doc example is no longer valid since commit f38c27561142446153eacd162c56c379542349b4. Now using TypeScript instead of pure JSON.