Skip to content

fontello/wawoff2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Vitaly Puzrin
Jan 19, 2022
2ba7510 · Jan 19, 2022

History

38 Commits
Apr 2, 2021
Apr 3, 2021
Jan 19, 2022
Jan 19, 2022
Apr 3, 2021
Apr 3, 2021
Feb 7, 2018
Jan 19, 2022
Dec 2, 2017
Apr 2, 2021
Apr 3, 2021
Apr 3, 2021
Apr 3, 2021
Jan 19, 2022

Repository files navigation

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.