romanize-deromanize v2.0.2
romanize ↔ deromanize
About
Roman numerals are a numeral system that originated in ancient Rome and remained the usual way of writing numbers throughout Europe well into the Late Middle Ages.
This JavaScript module allows you to convert roman numbers to arabic and vice versa with ease. It's programmed in TypeScript so it can be used with both JS & TS projects.
Installation
Add module to your project dependencies:
$ npm install romanize-deromanizeUsage
Simply include the library
const {romanize, deromanize} = require('romanize-deromanize');and use the following two methods:
romanize(214); // returns 'CCXIV'deromanize('DCLXXI'); // returns 671Development
Code formatting is done by Prettier.
Simply format project files by following predefined rules in .prettierrc.json:
$ npm run prettywhich is an alias for:
$ npx prettier --write .To exclude files from formatting, please refer to .prettierignore (corresponds to .gitignore).
Identifying problematic patterns is covered by static code analysis tool ESLint:
$ npm run lintwhich is an alias for:
$ npx eslint .Linting config can be found in .eslintrc.json.
If you want to run all "prod-ready" scripts successively: format, build, lint & test - simply run:
$ npm run allwhich is short for:
$ npm run pretty && npm run build && npm run lint & npm run testTesting
Unit tests are conducted using Jest. Run all tests from project root using the following command:
$ npm tor just run a single test suite by specifying its name, e.g.:
$ npm t romanize.test.tsIssues
If you experience any problems or you just need an extra feature - feel free to create new GitHub repo issue.