https://github.com/xvezda/golfy
:golf: An aggressive JavaScript minifier for code golf.
https://github.com/xvezda/golfy
babel-plugin code-golf codegolfing compressor javascript mangler minifier obfuscator uglify
Last synced: 4 months ago
JSON representation
:golf: An aggressive JavaScript minifier for code golf.
- Host: GitHub
- URL: https://github.com/xvezda/golfy
- Owner: Xvezda
- License: mit
- Created: 2025-05-01T16:23:43.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-05-19T08:03:47.000Z (6 months ago)
- Last Synced: 2025-06-30T15:04:41.371Z (5 months ago)
- Topics: babel-plugin, code-golf, codegolfing, compressor, javascript, mangler, minifier, obfuscator, uglify
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/golfy
- Size: 86.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
An aggressive JavaScript minifier for code golf.
golfy is a program that converts the input code into code optimized for code golf.
## Example
The following code
```javascript
const fs = require('fs');
const input = fs.readFileSync('/dev/stdin');
console.log(input);
```
can be transformed as follows
```javascript
console.log(require("fs").readFileSync(0))
```
## Goals
The goals of this project are as follows:
- Shorter code over stability
- Optimization of the output over processing time
- The shortest possible expression, even if it's hacky
The things this project does not aim for:
- Ensuring compatibility across various runtime environments and backward compatibility
- Maintaining internal implementation consistency with the input code (as long as the same input produces the same output, it's fine)
- Execution performance (code length takes priority)
## Usage
> [!WARNING]
> WIP project and is highly experimental and unstable.
```sh
npm install -g golfy
golfy code.js
# or
cat code.js | golfy
```