Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fontello/wawoff2
WebAssembly build of Google's woff2
https://github.com/fontello/wawoff2
Last synced: 6 days ago
JSON representation
WebAssembly build of Google's woff2
- Host: GitHub
- URL: https://github.com/fontello/wawoff2
- Owner: fontello
- License: mit
- Created: 2018-01-27T18:04:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T22:25:06.000Z (over 2 years ago)
- Last Synced: 2024-10-29T10:45:08.348Z (10 days ago)
- Language: JavaScript
- Size: 2.32 MB
- Stars: 72
- Watchers: 5
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs - wawoff2 - WebAssembly build of Google's woff2. (Repository / Font)
README
woff2 for node.js (via WebAssembly)
===================================[![CI](https://github.com/fontello/wawoff2/actions/workflows/ci.yml/badge.svg)](https://github.com/fontello/wawoff2/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/wawoff2.svg?style=flat)](https://www.npmjs.org/package/wawoff2)Google's [woff2](https://github.com/google/woff2) build for `node.js`, using
WebAssembly. Why this is better than binary bindings:- works everywhere without rebuild
Install
-------```sh
npm install wawoff2
```Use Example
-----------```js
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:
```bash
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:
```bash
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.
```