2.0.1 • Published 3 years ago

groff-escape v2.0.1

Weekly downloads
113
License
MIT
Repository
github
Last release
3 years ago

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

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

4 years ago

1.0.2

5 years ago

1.0.1

7 years ago

1.0.0

8 years ago