Code Monkey home page Code Monkey logo

chalk256's People

Contributors

ccheever avatar poying avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

brettz9 pczarn

chalk256's Issues

Slow as molasses

I didn't look into how you're doing this, but crayon(n)('some string') is massively slow.

Essentially all you need to do is "\x1b[38;5;" + n + "m" + "some string" .. so some perf is in order.

Swapping out your lib for a simple custom function that did that resulted in what looked like a 100x boost.

// Set just the background console.log(chalk(null, "gray")("this will be the default text color on gray"));

from your README:

// Set just the background
console.log(chalk(null, "gray")("this will be the default text color on gray"));

That code blows up.
Error: Don't understand the color 'null'
at getColorNumber (/Users/matt/workspace/junk/node_modules/chalk256/node_modules/crayon/crayon.js:241:13)
at ansiStyle (/Users/matt/workspace/junk/node_modules/chalk256/node_modules/crayon/crayon.js:258:29)
at t (/Users/matt/workspace/junk/node_modules/chalk256/node_modules/crayon/crayon.js:292:16)
at general (/Users/matt/workspace/junk/node_modules/chalk256/node_modules/crayon/crayon.js:299:21)
at module.exports.crayon (/Users/matt/workspace/junk/node_modules/chalk256/node_modules/crayon/crayon.js:307:34)
at repl:1:14
at REPLServer.self.eval (repl.js:110:21)
at Interface. (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)

chalk256 v4.0.0 installed via NPM.
node v0.10.26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.