Bot releases are hidden (Show)
Improvements
colorSupport
value changes
colorSupport
has effect on instance stylescolor_support
extension now uses new Deno.Command
APICode:
import { crayon as c332, colors, attributes } from "https://deno.land/x/[email protected]/mod.ts";
import { crayon as c333 } from "https://deno.land/x/[email protected]/mod.ts";
const styles = [...colors.keys(), ...attributes.keys()]
await Deno.bench({ name: "C 3.3.3", group: "a", baseline: true }, () => {
for (let i = 0; i < 1000; ++i) {
const a = styles[~~(Math.random() * styles.length)];
const b = styles[~~(Math.random() * styles.length)];
const c = styles[~~(Math.random() * styles.length)];
const d = styles[~~(Math.random() * styles.length)];
c333[a][b][c][d]("hi")
}
});
await Deno.bench({ name: "C 3.3.2", group: "a" }, () => {
for (let i = 0; i < 1000; ++i) {
const a = styles[~~(Math.random() * styles.length)];
const b = styles[~~(Math.random() * styles.length)];
const c = styles[~~(Math.random() * styles.length)];
const d = styles[~~(Math.random() * styles.length)];
c332[a][b][c][d]("hi")
}
});
Result on my machine:
Published by Im-Beast over 2 years ago
Improvements
crayon-js
organization new profile picture and crayon repository new social previewBug fixes
CustomEvent
compatibility layer for node which should hopefully make crayon.js
package prepare & publish normally.Published by Im-Beast over 2 years ago
Improvements
usesFunc
property to Crayon
instance
Bug fixes
Published by Im-Beast over 2 years ago
Improvements
deno.land/x
prototype.colorSupport
changessrc/extensions
directory has been addedBug fixes
replaceAll()
function now accounts for word getting moved within searchIndex
and offset
Published by Im-Beast over 2 years ago
Improvements
badges/
hex()
error handling has been improvedBug fixes
bgAnsi3
now returns proper colorkeyword()
typings now work as expectedcached-long-chain
bench's label is now properly namedBREAKING CHANGES
keyword()
doesn't return undefined
anymore and instead throwscompileType
and ansi256
from literal.ts
and chalk_aliases.ts
respectively are no longer exportedPublished by Im-Beast over 2 years ago
Bug fixes
Published by Im-Beast over 2 years ago
Improvements
crayon.js
no matter the changes.Bug fixes
NO_COLOR
environment variable was improperly interpreted inside the code. It has been fixed.Published by Im-Beast over 2 years ago
Improvements
NO_COLOR
is present has been minimized.Bug fixes
NO_COLOR
environment variable was improperly interpreted inside the code. It has been fixed.Published by Im-Beast over 2 years ago
crayon.js
package will still be generated using dnt
New features:
hex
function can now take number as an argument, e.g.: hex(0x0808ff)
as well as lowercase hexadecimal letters: hex("#0808ff")
BREAKING CHANGES:
crayonPrototype
has been renamed to prototype
.clearCache
, clone
, instance
functions were deprecated because of new non-mutating nature of crayon.crayon()
doesn't return Crayon instance anymore because of the same reasons, instead it will return "undefined"
as calling crayon now requires at least 1 argument.optimizeStyles
function is now method of crayon
called optimize
, it's majorly improved.clamp
function from util.ts
has been removed.Enormous performance gain was caused by many micro-optimizations:
replace
and replaceAll
functioncrayon
multiple (and in some scenarios tens) times faster than chalk
and previous versions of `crayon 🥳Published by Im-Beast about 3 years ago
addStyleFunctions
Published by Im-Beast over 3 years ago
+ const x = crayon as any as Crayon<...>
- const x = crayon as Crayon<...>
rgb -> ansi8
and rgb -> ansi4
color conversion import crayon from 'crayon.js';
import { Crayon } from 'crayon.js/lib/types';
/*
Styles - Template Literal Type
example: 'gray' | 'grey'
default: void
Functions - Template Literal Type
example: 'rainbowize' | 'somethingelse'
default: void
Object - object
example: {
rainbowize: (shift: number) => Crayon<Styles, Functions, Object>
}
default: void
*/
type Styles = 'gray' | 'grey';
type Functions = 'somethingelse';
type Object = {
rainbowize: (shift: number) => Crayon<Styles, Functions, Object>
};
const typedCrayon = crayon as any as Crayon<Styles, Functions, Object>;
// now typedCrayon has autocompletion for gray, grey, somethingelse (no arguments autocompletion) and rainbowize
Published by Im-Beast over 3 years ago
Published by Im-Beast over 3 years ago
Added support for 🦕 Deno
Published by Im-Beast over 3 years ago
@crayon.js/keywords
package, see here and here.@crayon.js/color-support
package, see here and here.- crayon.colorSupport
+ crayon.config.colorSupport
@crayon.js/lite
is deprecated - main crayon.js
package is now the same out of the box without using extension packages.@crayon.js/color-support
and @crayon.js/keywords
)Published by Im-Beast over 3 years ago
Make crayon.js work on deno
Published by Im-Beast over 3 years ago