Introduction

This npm module exposes a simple function that converts given number to roman numeral. The function takes a number type as an argument and returns a string. For simplicity, only positive integers smaller then 5000 are supported. Subtractive notation is used as the roman numeral standard.

Usage

Add this package to your dependencies. Import and use as follows:

const { convertToRomanNumeral } = require('./init.js');
convertToRomanNumeral(5) // returns 'V'
convertToRomanNumeral(11) // returns 'XI'

Tests

Run the tests using the following command:

yarn test

or,

npm test