@crayon.js/color-support
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

🖍️ Crayon.js color support


📚 About

This package is extension for crayon.js however it can still be used by other packages.

Installation

npm install @crayon.js/color-support #yarn add @crayon.js/color-support

Syntax

interface CrayonColorSupport {
	threeBitColor: boolean
	fourBitColor: boolean
	highColor: boolean
	trueColor: boolean
}

Usage

import { getColorSupport, supportedColors, getWindowsVersion } from '@crayon.js/color-support';

const support = getColorSupport(); // detect terminal color support
const cached = supportedColors(); // cached getColorSupport (it just returns cached object)
const windowsVersion = getWindowsVersion(); // Reusable function [version (7/8/10...), versionId (14931...)], empty if detected system is not Windows

Usage with crayon.js

import crayon from 'crayon.js'; // it'll still work with packages that extend crayon instance as its config is global
import { getColorSupport } from '@crayon.js/color-support';

crayon.config.colorSupport = getColorSupport();

🤝 Contributing

Feel free to add any commits, issues and pull requests

📝 Licensing

This project is available under MIT License conditions.

Package Sidebar

Install

npm i @crayon.js/color-support

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

5.24 kB

Total Files

6

Last publish

Collaborators

  • im-beast