nengo-full

0.5.1 • Public • Published

Nengo-full

Build Status Coverage Status

A library that converts Gregorian calendar dates into the traditional Japanese calendar years.

Installation

npm install nengo-full

Usage

Currently two functions are provided by nengo as shown below:

const { japaneseYear, gregorianYearRange } = require('nengo-full');

To convert the Gregorian date into the Japanese calendar, use the japaneseYear function. The output should be an object containing data related to the Japanese calendar year:

japaneseYear(new Date(1989, 2));
{
  "startYear": 1989,
  "names": ["Heisei", "平成", "へいせい"],
  "currentJapaneseYear": 0
}

To get information about a particular Japanese period in Gregorian calendar year format, use the gregorianYearRange function. The output should be an object containing data related to the :

gregorianYearRange("昭和");
{
  startYear: 1926,
  endYear: 1988
}

Tests

To run the test suite, run the command:

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using the following command:

npm run-script lint

Package Sidebar

Install

npm i nengo-full

Weekly Downloads

2

Version

0.5.1

License

ISC

Unpacked Size

37.4 kB

Total Files

10

Last publish

Collaborators

  • dragouf