{
 "kind": "tool",
 "slug": "picocolors",
 "path": "tools/picocolors/",
 "name": "picocolors",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Dev workflow and config",
   "tools/dev-workflow/"
  ]
 ],
 "lead": "Colored text for command-line tools.",
 "chips": [
  {
   "label": "Dev workflow and config",
   "path": "tools/dev-workflow/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install picocolors"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/alexeyraspopov/picocolors"
  },
  {
   "label": "Website",
   "href": "https://github.com/alexeyraspopov/picocolors#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "ISC",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted",
   "note": "ISC allows use in paid and closed tools.",
   "src": "https://github.com/alexeyraspopov/picocolors/blob/main/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Quiet for a year",
   "status": "cond",
   "sub": "Last change Nov 18, 2024",
   "note": "Latest GitHub release Oct 16, 2024. ",
   "src": "https://github.com/alexeyraspopov/picocolors"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "15 projects",
   "status": "info",
   "sub": "#82 of 299 in its category",
   "note": "Dependency in 15 public GitHub projects set up for AI coding agents that we scanned (0.2%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What picocolors does",
   "parts": [
    {
     "t": "prose",
     "text": "picocolors is a very small free JavaScript library that paints text in the terminal, like a green tick for done or red for an error. Your own command-line tools and scripts become easier to read. It turns colors off by itself when the output goes to a file or the person asked for no color."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Readable build and deploy messages",
       "text": "A script that builds or deploys your site prints done in green, warnings in yellow and failures in red, so problems stand out in a long log.",
       "idea": false
      },
      {
       "title": "A no-color option in your tool",
       "text": "Give people a switch that prints plain text, for screen readers, old terminals or saved logs.",
       "idea": false
      },
      {
       "title": "Make a tool lighter by dropping chalk",
       "text": "A small tool that only needs a few colors can swap chalk for picocolors and keep the same output.",
       "idea": false
      },
      {
       "title": "Respect people who turned color off",
       "text": "People who set NO_COLOR, or pass a no-color flag, get plain text from your tool without extra code.",
       "idea": false
      },
      {
       "title": "Highlight results of a data script",
       "text": "A one-off script that cleans a spreadsheet or checks links prints the rows it changed in green and the ones it skipped in gray.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "picocolors popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "63",
       "of": "/ 100",
       "l": "Gid Score, #789 overall"
      },
      {
       "n": "358M",
       "l": "downloads a week, npm"
      },
      {
       "n": "1,757",
       "l": "GitHub stars"
      },
      {
       "n": "15",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How picocolors is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "picocolors is a dependency in 15 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 96 projects, and what it is used with below comes from all of them.",
      "The most used alternative in our scan is chalk (181 projects).",
      "Projects that use it most often also use tsx (50.0%), TypeScript (91.7%), Clack Prompts (38.5%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "12 projects, 0.4%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "5 projects, 1.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "5 projects, 0.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 50.0% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 91.7% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 38.5% of its projects",
       "v": "Clack Prompts",
       "path": "tools/clack-prompts/"
      },
      {
       "l": "In 31.2% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      },
      {
       "l": "In 51.0% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 55.2% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 24.0% of its projects",
       "v": "yaml",
       "path": "tools/yaml/"
      },
      {
       "l": "In 22.9% of its projects",
       "v": "esbuild",
       "path": "tools/esbuild/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about picocolors",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Dev workflow and config",
       "path": "tools/dev-workflow/",
       "items": [
        {
         "text": "dotenv",
         "path": "tools/dotenv/"
        },
        {
         "text": "Husky",
         "path": "tools/husky/"
        },
        {
         "text": "python-dotenv",
         "path": "tools/python-dotenv/"
        },
        {
         "text": "lint-staged",
         "path": "tools/lint-staged/"
        },
        {
         "text": "concurrently",
         "path": "tools/concurrently/"
        },
        {
         "text": "Rich",
         "path": "tools/rich/"
        },
        {
         "text": "Pydantic Settings",
         "path": "tools/pydantic-settings/"
        },
        {
         "text": "cross-env",
         "path": "tools/cross-env/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "picocolors",
       "me": true,
       "facts": [
        "ISC",
        "Gid 63",
        "358M/wk"
       ]
      },
      {
       "name": "chalk",
       "why": "Pick chalk when you want chained styles (chalk.red.bold) or exact hex colors; current chalk 6 needs Node.js 22 and ESM.",
       "path": "tools/chalk/",
       "facts": [
        "MIT",
        "Gid 80",
        "66M/wk"
       ]
      },
      {
       "name": "Consola",
       "why": "Pick Consola when you want ready log levels and formatted messages, not just colored strings.",
       "path": "tools/consola/",
       "facts": []
      },
      {
       "name": "Rich",
       "why": "Pick Rich when the command-line tool is written in Python.",
       "path": "tools/rich/",
       "facts": []
      }
     ],
     "more": "Compare picocolors with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use picocolors (pin picocolors@1.1.1) for terminal colors in this Node.js script; nest calls like pc.red(pc.bold(text)), add a --no-color option with pc.createColors, and keep logs written to files free of colors."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add picocolors to your Node.js project with your package manager (npm install picocolors), then import it.",
       "code": "import pc from \"picocolors\"",
       "src": "https://github.com/alexeyraspopov/picocolors/blob/main/README.md"
      },
      {
       "text": "Wrap the text you print in a color or style function; nest calls to combine them.",
       "code": "console.log(\n  pc.green(`How are ${pc.italic(`you`)} doing?`)\n)\n",
       "src": "https://github.com/alexeyraspopov/picocolors/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "pc.red.bold(\"Failed\")",
       "fix": "pc.red(pc.bold(\"Failed\"))",
       "why": "picocolors functions are plain functions without chained properties; chalk-style chains do not exist."
      },
      {
       "dont": "pc.hex(\"#2B59C3\")(\"Brand\") or pc.rgb(...)",
       "fix": "Use one of the 16 named colors (pc.blue, pc.cyanBright ...) or switch to chalk for exact colors",
       "why": "The README lists only named colors, backgrounds and styles; there is no hex or rgb function."
      },
      {
       "dont": "Expecting colored strings in a web page or browser console after bundling",
       "fix": "Use picocolors only for terminal output; style web pages with CSS",
       "why": "The package's browser entry maps to a build where every function returns the plain string."
      },
      {
       "dont": "Writing pc.red(...) results into a JSON log or a file that other programs read",
       "fix": "Make a plain set with pc.createColors(false) for anything that is not shown in a terminal",
       "why": "With colors on, the strings carry escape codes; in our run line 4 came back as \"\\u001b[31m\\u001b[1m✖ Upload failed:...\""
      },
      {
       "dont": "Colors missing in CI logs and adding chalk just to force them",
       "fix": "Set FORCE_COLOR=1 (or pass --color) in the CI job; CI=true alone already turns them on",
       "why": "picocolors checks FORCE_COLOR, --color, a terminal and CI before it turns colors on (our run showed true for CI=true)."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it work with both require and import?",
       "a": "Yes. The README says it supports both CommonJS and ES module projects and ships TypeScript types.",
       "evidence": {
        "url": "https://github.com/alexeyraspopov/picocolors/blob/main/README.md",
        "quote": "Support for both CJS and ESM projects."
       }
      },
      {
       "q": "Can I write chalk.red.bold style chains?",
       "a": "No. You nest calls instead, like pc.red(pc.bold(text)).",
       "evidence": {
        "url": "https://github.com/alexeyraspopov/picocolors/blob/main/README.md",
        "quote": "Replace chains to nested calls"
       }
      },
      {
       "q": "How do I know if colors will show?",
       "a": "Read pc.isColorSupported. It is false when NO_COLOR is set, with --no-color, or when output is not a terminal.",
       "evidence": {
        "url": "https://github.com/alexeyraspopov/picocolors/blob/main/README.md",
        "quote": "isColorSupported — boolean, explicitly tells whether or not the colors or formatting appear on the screen"
       }
      },
      {
       "q": "Can I use it in a commercial tool?",
       "a": "Yes. The ISC license allows any use with or without fee, as long as the notice stays with copies.",
       "evidence": {
        "url": "https://github.com/alexeyraspopov/picocolors/blob/main/LICENSE",
        "quote": "Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm picocolors"
  ],
  [
   "Category",
   "Dev workflow and config"
  ],
  [
   "License",
   "ISC"
  ],
  [
   "Gid Score",
   "63.2"
  ],
  [
   "Rank in category",
   "#82 of 299"
  ],
  [
   "GitHub",
   "alexeyraspopov/picocolors"
  ],
  [
   "Last change",
   "Nov 18, 2024"
  ]
 ],
 "good": [
  "It has no other packages inside and runs on very old Node.js versions too.",
  "It has only the 16 basic terminal colors plus bold, dim, italic and similar styles; there is no way to pick an exact color code like a brand hex value.",
  "Colors are on in a terminal, on build servers that set CI, and with FORCE_COLOR; output piped to a file stays plain."
 ],
 "checked_line": "Read by AgentGid from 6 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/alexeyraspopov.png"
}