groff-escape
v2.0.1
Published
Map of non-ASCII characters to Groff commands
Downloads
6,025
Readme
groff-escape
Map of non-ASCII characters to Groff commands.
Contents
What is this?
This package maps non-ASCII characters to Groff commands.
For example, it maps '≠'
to '!='
(which you’ll need to wrap like so \[!=]
to use in Groff).
When should I use this?
You can use this package if you’re writing stuff that compiles to Groff / man pages.
Install
This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:
npm install groff-escape
In Deno with Skypack:
import {groffEscape} from 'https://cdn.skypack.dev/groff-escape@2?dts'
In browsers with Skypack:
<script type="module">
import {groffEscape} from 'https://cdn.skypack.dev/groff-escape@2?min'
</script>
Use
import {groffEscape} from 'groff-escape'
console.log(groffEscape)
Yields:
{ '≠': '!=',
'À': '`A',
'Á': '\'A',
'Â': '^A',
'Ã': '~A',
// …
'♥': 'HE',
'♦': 'DI',
'✓': 'OK',
'⟨': 'la',
'⟩': 'ra' }
API
This package exports the following identifiers: groffEscape
.
There is no default export.
groffEscape
Map of non-ASCII characters to Groff commands (Record<string, string>
).
Types
This package is fully typed with TypeScript. There are no extra types exported.
Compatibility
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. It also works in Deno and modern browsers.
Security
This package is safe.
Related
remarkjs/remark-man
— turn markdown into man pages
Contribute
Yes please! See How to Contribute to Open Source.