Skip to content

Commit

Permalink
Browser support
Browse files Browse the repository at this point in the history
  • Loading branch information
dkin-om committed Dec 27, 2020
1 parent 24f1de6 commit 10a91f2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
26 changes: 23 additions & 3 deletions README.md
Expand Up @@ -7,20 +7,40 @@
[![Coverage Status](https://coveralls.io/repos/github/dkin-om/romanice/badge.svg)](https://coveralls.io/github/dkin-om/romanice)
[![License](https://img.shields.io/npm/l/romanice)](https://github.com/dkin-om/romanice/blob/master/LICENSE)

A JavaScript library for converting to/from Roman numerals, e.g., `3888``MMMDCCCLXXXVIII`, `3999``MMMCMXCIX`
A JavaScript library for converting to/from Roman numerals, e.g., `3888``MMMDCCCLXXXVIII`, `38888``ↂↂↂↁↀↀↀⅮⅭⅭⅭⅬⅩⅩⅩⅤⅠⅠⅠ`

## Install

```
npm install romanice
```

## Import

### CommonJS

```javascript
const Romanice = require('romanice');
```

### ES6

```javascript
import * as Romanice from 'romanice';
```

### Browser

```html
<script src="https://cdn.jsdelivr.net/npm/romanice/dist/romanice.min.js"></script>
```

## Usage

### Standard - `I`, `V`, `X`, `L`, `C`, `D`, `M`

```javascript
const { romanice } = require('romanice');
const { romanice } = Romanice;
const standardConverter = romanice();

const roman = standardConverter.toRoman(3888);
Expand All @@ -33,7 +53,7 @@ const decimal = standardConverter.fromRoman('MMMCMXCIX');
### Unicode - ``, ``, ``, ``, ``, ``, ``, ``, ``

```javascript
const { romanice, symbols } = require('romanice');
const { romanice, symbols } = Romanice;
const unicodeConverter = romanice(symbols.UNICODE);

const roman = unicodeConverter.toRoman(38888);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "romanice",
"version": "1.2.0",
"version": "2.0.0",
"description": "Convert to/from Roman numerals",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.babel.js
Expand Up @@ -6,7 +6,7 @@ export default {
output: {
path: resolvePath(__dirname, 'dist'),
filename: 'romanice.min.js',
library: 'romanice',
library: 'Romanice',
libraryTarget: 'umd',
globalObject: 'this',
},
Expand Down

0 comments on commit 10a91f2

Please sign in to comment.