Socket
Socket
Sign inDemoInstall

romans

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    romans

A small, no-dependency lib for converting to and from roman numerals


Version published
Weekly downloads
3.6K
increased by20.29%
Maintainers
1
Install size
82.4 kB
Created
Weekly downloads
 

Readme

Source

A no-dependency library for converting from decimal notation to roman 🏛 numerals and back again.

quality tests

ko-fi

Install

With npm, pnpm, or yarn installed, run:

$ yarn add romans

Usage

const romans = require('romans');
romans.romanize(454)
// returns: 'CDLIV'

romans.deromanize('CDLIV')
// returns: 454

romans.allNumerals
// array containing the numeric equivalents of the roman characters
// [ 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 ]

romans.allChars
// array containing all roman numeral characters
// [ 'M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I' ]

Testing

coverage Wallaby.js

Test coverage is reported via codecov, and run on every release

$ yarn test

License

FOSSA Status

MIT

Contributions

If you'd like to contribute to this library, please send a PR or file a new issue. I aim to get PRs accepted in short order should they align with the goals. Also, be nice.

Keywords

FAQs

Last updated on 18 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc