{"id":15975795,"url":"https://github.com/matthewoestreich/chalky","last_synced_at":"2025-08-08T04:37:51.528Z","repository":{"id":47550577,"uuid":"255764408","full_name":"matthewoestreich/chalky","owner":"matthewoestreich","description":"Like chalk.js, but smaller and with fewer features. Meant for rapid prototyping without worrying about node_modules bloat","archived":false,"fork":false,"pushed_at":"2022-07-21T00:24:42.000Z","size":103,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T07:15:52.498Z","etag":null,"topics":["chalk","chalkjs","chalky","chalkyjs","colors","console","express","expressjs","log","node","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewoestreich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T00:49:39.000Z","updated_at":"2024-02-13T12:23:07.000Z","dependencies_parsed_at":"2022-09-16T16:43:29.578Z","dependency_job_id":null,"html_url":"https://github.com/matthewoestreich/chalky","commit_stats":null,"previous_names":["oze4/smallchalk","matthewoestreich/chalky","oze4/chalky"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewoestreich%2Fchalky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewoestreich%2Fchalky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewoestreich%2Fchalky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewoestreich%2Fchalky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewoestreich","download_url":"https://codeload.github.com/matthewoestreich/chalky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241801255,"owners_count":20022390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chalk","chalkjs","chalky","chalkyjs","colors","console","express","expressjs","log","node","nodejs"],"created_at":"2024-10-07T22:05:11.861Z","updated_at":"2025-03-04T07:15:55.644Z","avatar_url":"https://github.com/matthewoestreich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/chalky.svg)](https://badge.fury.io/js/chalky)\n\n`npm i chalky` / `yarn add chalky`\n\n# chalky\n\n# Table of Contents\n\n - [About](#about)\n - [Demos](#demos)\n   - [Chaining](#chaining)\n   - [Color priority in chain](#color-priority-in-chain)\n   - [Rainbow](#rainbow)\n - [Properties / API](#properties)\n - [Why?](#why)\n\n ---\n\n# About\n\nLike [chalk](https://www.npmjs.com/package/chalk) with fewer features, smaller in size ([905 bytes](https://bundlephobia.com/result?p=chalky@)), and self-contained ([zero dependencies](https://www.npmjs.com/package/chalky?activeTab=dependencies)).  Think of `chalky` like a 'stripped down', basic version of [chalk](https://www.npmjs.com/package/chalk).. \n\n`chalky` aims to provide a [chalk](https://www.npmjs.com/package/chalk)-like experience, but for the most basic of console color features. Simple and small. 'Cheaply' add color to your console without worrying about the size of `node_modules`.\n\nWe're not quite hardened [chalk](https://www.npmjs.com/package/chalk), but we're still `chalky` :smirk: \n\n ---\n\n# Demos\n\n### Chaining \n\n  - Like [chalk](https://www.npmjs.com/package/chalk), chain methods together to change the foreground color, background color, add formatting (italic, bold, underline, etc..), for unique color/formatting combinations.\n\n```javascript\nconst chalky = require('chalky');\n\nconsole.log(\n  chalky.italic.bgBlack.red.bold(\"Lorem ipsum dolor sit amet\")\n);\n```\n\n - Output:\n\u003cimg src=\"https://raw.githubusercontent.com/oze4/chalky/master/docs/demo_0.png\" width=\"300\" height=\"40\" alt=\"demo\"/\u003e\n\n### Color priority in chain\n\n - The last color in the chain is what gets used:\n\n```javascript\nconst chalky = require('chalky');\n\n// This line..\nconst a = chalky.red.green.blue.bgRed.bgBlack.bgYellow(\"Lorem ipsum dolor sit amet\");\n// ...is equivalent to this line\nconst b = chalky.blue.bgYellow(\"Lorem ipsum dolor sit amet\");\n\nconsole.log(`This:         ${a}`);\nconsole.log(`Should equal: ${b}`);\n```\n - Output:\n\u003cimg src=\"https://raw.githubusercontent.com/oze4/chalky/master/docs/demo_1.png\" width=\"300\" height=\"40\" alt=\"demo\"/\u003e\n\n\u003cbr /\u003e\n\n```javascript\nconst chalky = require('chalky');\n\n// This line..\nconst a = chalky.red.blue(\"Lorem ipsum dolor sit amet\");\n// ...is equivalent to this line\nconst b = chalky.blue(\"Lorem ipsum dolor sit amet\");\n\nconsole.log(`This:         ${a}`);\nconsole.log(`Should equal: ${b}`);\n```\n\n - Output:\n\u003cimg src=\"https://raw.githubusercontent.com/oze4/chalky/master/docs/demo_2.png\" width=\"300\" height=\"40\" alt=\"demo\"/\u003e\n\n### Rainbow\n\n - Use `chalky.rainbow('Some string')` to 'rainbowify' a string\n\n```javascript\nconst chalky = require('chalky');\n\nconsole.log(\n  chalky.rainbow(\"Lorem ipsum dolor sit amet\")\n);\n```\n\n - Output:\n\u003cimg src=\"https://raw.githubusercontent.com/oze4/chalky/master/docs/demo_rbow.png\" width=\"300\" height=\"40\" alt=\"demo\"/\u003e\n\n---\n\n# Properties\n\n - **Foreground Colors:**\n   - `black`\n   - `red`\n   - `green`\n   - `yellow`\n   - `blue`\n   - `magenta`\n   - `cyan`\n   - `white`\n   \n - **Background Colors:**\n   - `bgBlack`\n   - `bgRed`\n   - `bgGreen`\n   - `bgYellow`\n   - `bgBlue`\n   - `bgMagenta`\n   - `bgCyan`\n   - `bgWhite`\n \n - **Formatting:**\n   - `bold`\n   - `light`\n   - `italic`\n   - `underline`\n   - `blink`\n   - `inverse`\n   - `hidden`\n\n---\n   \n# Why?\n\nTwo reasons... \n\nI wanted to understand:\n - How chalk was able to use properties with the same name as both a getter and method on the same object\n   - For example, you can do `chalk.blue('foo');` and `chalk.blue.bold('foo');` (`.blue` is being used as both a method and getter)\n - How chalk was able to chain these properties/methods/getters\n \n While modified, some of the code in this repo may resemble chalk as I followed the same logic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewoestreich%2Fchalky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewoestreich%2Fchalky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewoestreich%2Fchalky/lists"}