Registry / devops / crop-awesome

crop-awesome

JSON →
library0.9.22jsnpmunverified

Crop-awesome (v0.9.22) is a build-time tool that reduces Font Awesome CSS and font file sizes by removing unused icons and classes. It supports EOT, TTF, SVG, WOFF, WOFF2, and OTF font types, with configurable icon lists and helper classes. Unlike manual subsetting or online tools, it integrates as a CLI or Node.js dependency, with autocomplete for repeat runs (though buggy in global mode). Last updated in 2017, the project is in maintenance mode—no changes since, but still usable for Font Awesome 4.x.

npm install crop-awesome
INSTALL
IMPORT
SIG · CROP-AWESOME
C
crop-awesome
devopsjavascriptv0.9.22
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const crop = require('crop-awesome')
import crop from 'crop-awesome'
Package is CJS-only; no ESM wrapper. Use require().
crop()
const crop = require('crop-awesome'); crop({icons: ['cog']})
crop-awesome -icons=cog
crop is a function, not a CLI invocation. CLI uses separate binary.
crop~Promise
crop({...}).then(({css, output_path}) => ...)
crop({...}, callback)
Returns a Promise, not a callback. Use .then() or async/await.

Shows programmatic usage: require, configure subset, handle Promise result.

const crop = require('crop-awesome'); crop({ font_types: ['woff2'], css_dest: './cropped.css', icons: ['glass', 'space', 'infinity', 'taxi'] }).then(res => { console.log(`CSS written to ${res.output_path}`); console.log(`Length: ${res.css.length} chars`); }).catch(err => console.error('Crop failed:', err));
Debug
Known issues
gotchaGlobal install `-g` does not support autocomplete; answers are not stored.
fix
Install locally or use config file via -cfg-path.
affects: >=0.9.0
gotchaOTF font type is binary and cannot be cropped; it merely copies original file.
fix
Avoid specifying OTF in font_types unless you want an untrimmed copy.
affects: >=0.9.0
gotchaCSS helper classes default set includes only lg, 2x, 3x, 4x, 5x, fw, border. Other FA helpers like spin, rotate are excluded unless added.
fix
Add missing helper classes to help_classes array in config.
affects: >=0.9.0
breakingIn version 0.9.0, the API changed from synchronous to Promise-based.
fix
Use .then() or async/await instead of expecting immediate result.
affects: >=0.9.0
deprecatedProject has not been updated since 2017; Font Awesome 5+ uses different structure (SVG with JS).
fix
Consider using fontawesome-subset or custom SVG icon extraction for FA5+.
affects: >=0.9.0
Errors
Common errors & fixes
TypeError: crop is not a function
Importing the CLI binary instead of the module function, or using ESM import.
fix
Use const crop = require('crop-awesome'); not require('crop-awesome').default.
Error: Cannot find module 'crop-awesome'
Package not installed or not in node_modules; global install not found.
fix
Run `npm install crop-awesome --save-dev` (or without -g).
ENOENT: no such file or directory, open '...'
Font Awesome source file not found; package expects font-awesome installed or files present.
fix
Ensure font-awesome is installed (npm install font-awesome) or specify custom path.
Upgrade
Version history
0.9.22latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
crop-awesome — npm install crop-awesome · libregistry