Détail du package

wawoff2

fontello195.4kMIT2.0.1

Convert TTF font to WOFF2

font, ttf, woff, woff2

readme

woff2 for node.js (via WebAssembly)

CI NPM version

Google's woff2 build for node.js, using WebAssembly. Why this is better than binary bindings:

  • works everywhere without rebuild

Install

npm install wawoff2

Use Example

const wawoff = require('wawoff2');

// src - Buffer or Uint8Array
wawoff.compress(src).then(out => {
  // store result
});

Command-line Example

To compress a .ttf file into a .woff2 file:

woff2_compress.js [-h] [-v] infile [outfile]

Positional arguments:
  infile         Input .ttf file
  outfile        Output .woff2 file (- for stdout)

Optional arguments:
  -h, --help     Show this help message and exit.
  -v, --version  Show program's version number and exit.

And the opposite, to decompress a .woff2 file into a .ttf one:

woff2_decompress.js [-h] [-v] infile [outfile]

Positional arguments:
  infile         Input .woff2 file
  outfile        Output .ttf file (- for stdout)

Optional arguments:
  -h, --help     Show this help message and exit.
  -v, --version  Show program's version number and exit.

changelog

2.0.1 / 2022-01-19

  • Changed build options to keep node.js uncaughtException & unhandledRejection handlers intact (#9).

2.0.0 / 2021-04-04

  • Refactor build process to use docker.
  • Rewrite bindings with EMSCRIPTEN_BINDINGS.
  • Deps bump.

1.0.2 / 2018-03-22

  • Improve CLI params support: single param & stdout.

1.0.1 / 2018-02-24

  • Fix crash on big font files (when memory growth happens).
  • Declare symlinks for CLI scripts.

1.0.0 / 2018-02-15

  • First release.