Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

πŸ–οΈ Crayon.js color support for πŸ¦• Deno


πŸ“š About

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

Syntax

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

Usage

import { getColorSupport, supportedColors, getWindowsVersion } from 'https://deno.land/x/crayon_color_support/mod.ts';

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 'https://deno.land/x/crayon/mod.ts'; // it'll still work with modules that extend crayon instance as its config is global
import { getColorSupport } from 'https://deno.land/x/crayon_color_support/mod.ts';

crayon.config.colorSupport = getColorSupport();

Wiki

To learn more about Crayon and its API look here

:handshake: Contributing

Feel free to add any commits, issues and pull requests

πŸ“ Licensing

This project is available under MIT License conditions.