https://github.com/delucis/femtocolors
A microscopic, zero-dependency library for styling terminal text in Node.js
https://github.com/delucis/femtocolors
ansi colors console styletext terminal zero-dependency
Last synced: 5 months ago
JSON representation
A microscopic, zero-dependency library for styling terminal text in Node.js
- Host: GitHub
- URL: https://github.com/delucis/femtocolors
- Owner: delucis
- Created: 2025-10-20T14:47:05.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-01-15T09:32:52.000Z (5 months ago)
- Last Synced: 2026-01-15T15:32:39.523Z (5 months ago)
- Topics: ansi, colors, console, styletext, terminal, zero-dependency
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/femtocolors
- Size: 248 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# femtocolors
A tiny, zero-dependency library for styling terminal text
- 130 bytes, total install size <2 KB
- Convenient chaining API
- Respects `NO_COLOR`
- Fully typed
- Supports [all `styleText()` styles](https://nodejs.org/api/util.html#modifiers)
- Node.js ≥20 only (see [picocolors](https://www.npm.im/picocolors) for other runtimes)
## Usage
```js
import fmt from 'femtocolors';
// Style by chaining properties
const success = fmt.green('Success!');
const error = fmt.black.bgRed('Error');
const link = fmt.blue.underline('https://example.com');
// You can also reuse formatters
const errorStyle = fmt.red.bold;
errorStyle('Error 1');
errorStyle('Error 2');
```
## License
MIT License © Copyright (c) 2025 Chris Swithinbank