romanize-deromanize
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

romanize ↔ deromanize

GitHub release testing workflow GitHub license code style: prettier

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-deromanize

Usage

Simply include the library

const {romanize, deromanize} = require('romanize-deromanize');

and use the following two methods:

romanize(214); // returns 'CCXIV'
deromanize('DCLXXI'); // returns 671

Development

Code formatting is done by Prettier. Simply format project files by following predefined rules in .prettierrc.json:

$ npm run pretty

which 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 lint

which 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 all

which is short for:

$ npm run pretty && npm run build && npm run lint & npm run test

Testing

Unit tests are conducted using Jest. Run all tests from project root using the following command:

$ npm t

or just run a single test suite by specifying its name, e.g.:

$ npm t romanize.test.ts

Issues

If you experience any problems or you just need an extra feature - feel free to create new GitHub repo issue.

References

Package Sidebar

Install

npm i romanize-deromanize

Weekly Downloads

2

Version

2.0.2

License

MIT

Unpacked Size

10.8 kB

Total Files

7

Last publish

Collaborators

  • aleksbelic