programming-language-colors
v1.2.0
Published
Helpful packaging of github programming language color codes for use in js and ts projects
Downloads
355
Maintainers
Readme
programming-language-colors
GitHub's programming language colors as an npm and JSR package. Data is sourced from github-linguist/linguist and updated automatically.
Installation
# npm
npm install programming-language-colors
# JSR
npx jsr add @ant-ms/programming-language-colors
# or
deno add jsr:@ant-ms/programming-language-colorsUsage
import { getLanguageColor, Colors } from "programming-language-colors";
// or for JSR: import { getLanguageColor, Colors } from "@ant-ms/programming-language-colors";
// Look up a single language color (case-insensitive)
getLanguageColor("TypeScript"); // "#3178c6"
getLanguageColor("python"); // "#3572A5"
getLanguageColor("C++"); // "#f34b7d"
getLanguageColor("not-real"); // undefined
// Aliases are also supported
getLanguageColor("ts"); // "#3178c6"
getLanguageColor("csharp"); // "#178600"
getLanguageColor("golang"); // "#00ADD8"
// Access the full color map directly
console.log(Colors);
// { "typescript": "#3178c6", "python": "#3572A5", ... }Data Source
Language color data is derived from the languages.yml file in the github-linguist/linguist repository. A daily automated check keeps the data in sync with upstream changes.
License
This project is licensed under the MIT License.
The language color data is derived from github-linguist/linguist, which is Copyright (c) 2017 GitHub, Inc. and also licensed under MIT. See THIRD_PARTY_NOTICES for details.
