Skip to content

xem/woff2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WOFF2 to self-extracting HTML brotli compressor thingy for code-golfing competitions

How to use it?

  • Install NodeJS
  • Put a txt file to compress in the same folder as the repo files (ex: test.txt).
  • Your txt file must be a JS script.
  • Run node packer.js test.txt test.html

What does it do?

  • The script compresses your txt file using the power of Brotli's dictionnary (and Brotli's advanced compression levels).
  • The compressed code can't be read directly by the browser, so it's embedded in a WOFF2 file (which supports Brotli compression).
  • A HTML file is generated, which is a self-extracting WOFF2 file.
  • When you open the HTML file in the browser, the contents of the txt file is evaluated.
  • WOFF2 garbage is also displayed in the browser, but you can use JS or CSS to hide it.
  • In many cases, the compression is much better than simply zipping the txt file (ex: test.txt becomes a 1.9kb file with this and 2.3kb with zip only).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published