https://github.com/richienb/script-case
Make text superscript or subscript.
https://github.com/richienb/script-case
Last synced: 6 months ago
JSON representation
Make text superscript or subscript.
- Host: GitHub
- URL: https://github.com/richienb/script-case
- Owner: Richienb
- License: mit
- Created: 2020-01-28T08:15:30.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-07T11:40:41.000Z (about 3 years ago)
- Last Synced: 2025-07-03T11:09:25.661Z (6 months ago)
- Language: JavaScript
- Size: 88.9 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Script Case [](https://travis-ci.com/Richienb/script-case)
Make text superscript or subscript.
[](https://npmjs.com/package/script-case)
## Install
```sh
npm install script-case
```
## Usage
```js
const scriptCase = require("script-case");
scriptCase.superscript("hello world");
//=> 'ʰᵉˡˡᵒ ʷᵒʳˡᵈ'
scriptCase.subscript("hello world")
//=> 'ₕₑₗₗₒ wₒᵣₗd'
```
You can also get the internal conversion dictionaries:
```js
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.