script-case

Make text superscript or subscript.

Usage no npm install needed!

<script type="module">
  import scriptCase from 'https://cdn.skypack.dev/script-case';
</script>

README

Script Case Travis CI Build Status

Make text superscript or subscript.

NPM Badge

Install

npm install script-case

Usage

const scriptCase = require("script-case");

scriptCase.superscript("hello world");
//=> 'ʰᵉˡˡᵒ ʷᵒʳˡᵈ'

scriptCase.subscript("hello world")
//=> 'ₕₑₗₗₒ wₒᵣₗd'

You can also get the internal conversion dictionaries:

const superscript = require("script-case/superscript")
//=> { "0": "⁰", "1": "¹", ... }

const subscript = require("script-case/subscript")
//=> { "0": "₀", "1": "₁", ... }

API

scriptCase.superscript(input)

input

Type: string

The string to convert.

scriptCase.subscript(input)

input

Type: string

The string to convert.