groff-escape
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

groff-escape

Build Coverage Downloads Size

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

Contribute

Yes please! See How to Contribute to Open Source.

License

MIT © Titus Wormer

Readme

Keywords

Package Sidebar

Install

npm i groff-escape

Weekly Downloads

1,322

Version

2.0.1

License

MIT

Unpacked Size

10.6 kB

Total Files

5

Last publish

Collaborators

  • wooorm