code-languages 1.4.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Structured metadata for programming languages, packaged as a typed, tree-shakeable TypeScript library.
10
10
 
11
- `code-languages` is useful when you need a small source of truth for language names, slugs, file extensions, release metadata, websites, paradigms, and logos in developer tools, docs sites, learning platforms, or editor-like interfaces. It currently includes metadata for 36 languages.
11
+ `code-languages` is useful when you need a small source of truth for language names, slugs, file extensions, release metadata, websites, paradigms, and logos in developer tools, docs sites, learning platforms, or editor-like interfaces. It currently includes metadata for 39 languages.
12
12
 
13
13
  ## Features
14
14
 
@@ -45,8 +45,10 @@ Import multiple languages:
45
45
 
46
46
  ```ts
47
47
  import { astro } from "code-languages/astro";
48
+ import { assembly } from "code-languages/assembly";
48
49
  import { bash } from "code-languages/bash";
49
50
  import { c } from "code-languages/c";
51
+ import { coffeescript } from "code-languages/coffeescript";
50
52
  import { cobol } from "code-languages/cobol";
51
53
  import { cpp } from "code-languages/cpp";
52
54
  import { csharp } from "code-languages/csharp";
@@ -65,6 +67,7 @@ import { markdown } from "code-languages/markdown";
65
67
  import { nginx } from "code-languages/nginx";
66
68
  import { objectiveC } from "code-languages/objective-c";
67
69
  import { php } from "code-languages/php";
70
+ import { powershell } from "code-languages/powershell";
68
71
  import { python } from "code-languages/python";
69
72
  import { scss } from "code-languages/scss";
70
73
  import { json } from "code-languages/json";
@@ -79,8 +82,10 @@ import { yaml } from "code-languages/yaml";
79
82
  import { zsh } from "code-languages/zsh";
80
83
 
81
84
  console.log(astro.version);
85
+ console.log(assembly.extensions);
82
86
  console.log(bash.version);
83
87
  console.log(c.extensions);
88
+ console.log(coffeescript.version);
84
89
  console.log(cpp.i18n.en.name);
85
90
  console.log(csharp.website);
86
91
  console.log(css.paradigms);
@@ -97,6 +102,7 @@ console.log(markdown.website);
97
102
  console.log(nginx.version);
98
103
  console.log(objectiveC.version);
99
104
  console.log(php.version);
105
+ console.log(powershell.extensions);
100
106
  console.log(python.publishedDate);
101
107
  console.log(scss.extensions);
102
108
  console.log(json.i18n.en.description);
@@ -116,8 +122,10 @@ Import from the package root when bundle size is not a concern:
116
122
  ```ts
117
123
  import {
118
124
  astro,
125
+ assembly,
119
126
  bash,
120
127
  c,
128
+ coffeescript,
121
129
  cpp,
122
130
  csharp,
123
131
  css,
@@ -138,6 +146,7 @@ import {
138
146
  nginx,
139
147
  objectiveC,
140
148
  php,
149
+ powershell,
141
150
  rust,
142
151
  scss,
143
152
  sql,
@@ -153,10 +162,12 @@ import {
153
162
  } from "code-languages";
154
163
 
155
164
  console.log(localizeLanguage(astro, "es").description);
165
+ console.log(localizeLanguage(assembly).description);
156
166
  console.log(detectLanguage("src/index.ts")?.slug);
157
167
  console.log(detectLanguages("include/config.h").map((language) => language.slug));
158
168
  console.log(localizeLanguage(bash, "es").description);
159
169
  console.log(c.version);
170
+ console.log(localizeLanguage(coffeescript).name);
160
171
  console.log(cpp.website);
161
172
  console.log(localizeLanguage(csharp).description);
162
173
  console.log(localizeLanguage(css).name);
@@ -172,6 +183,7 @@ console.log(markdown.extensions);
172
183
  console.log(localizeLanguage(nginx, "es").description);
173
184
  console.log(objectiveC.extensions);
174
185
  console.log(localizeLanguage(php, "es").description);
186
+ console.log(localizeLanguage(powershell).name);
175
187
  console.log(go.logo);
176
188
  console.log(localizeLanguage(scss).name);
177
189
  console.log(json.website);
@@ -254,8 +266,10 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
254
266
  | Logo | Language | Slug | Extensions | Version | Import |
255
267
  |---|---|---|---|---|---|
256
268
  | <img src="https://astro.build/assets/press/astro-icon-light.svg" alt="Astro logo" width="24" height="24"> | Astro | `astro` | `.astro` | `6.3.1` | `code-languages/astro` |
269
+ | <img src="https://cdn.simpleicons.org/assemblyscript/007AAC" alt="Assembly logo" width="24" height="24"> | Assembly | `assembly` | `.asm`, `.s`, `.S`, `.inc` | `Architecture-specific` | `code-languages/assembly` |
257
270
  | <img src="https://bashlogo.com/img/symbol/svg/full_colored_dark.svg" alt="Bash logo" width="24" height="24"> | Bash | `bash` | `.sh`, `.bash`, `.bashrc`, `.bash_profile`, `.bash_login`, `.profile` | `5.3` | `code-languages/bash` |
258
271
  | <img src="https://upload.wikimedia.org/wikipedia/commons/1/18/C_Programming_Language.svg" alt="C logo" width="24" height="24"> | C | `c` | `.c`, `.h` | `C23` | `code-languages/c` |
272
+ | <img src="https://cdn.simpleicons.org/coffeescript/2F2625" alt="CoffeeScript logo" width="24" height="24"> | CoffeeScript | `coffeescript` | `.coffee`, `.litcoffee`, `.cson` | `2.7.0` | `code-languages/coffeescript` |
259
273
  | <img src="https://logo.svgcdn.com/devicon/cobol-original.png" alt="COBOL logo" width="24" height="24"> | COBOL | `cobol` | `.cob`, `.cbl`, `.cobol`, `.cpy` | `ISO/IEC 1989:2023` | `code-languages/cobol` |
260
274
  | <img src="https://upload.wikimedia.org/wikipedia/commons/1/18/ISO_C%2B%2B_Logo.svg" alt="C++ logo" width="24" height="24"> | C++ | `cpp` | `.cpp`, `.cc`, `.cxx`, `.h`, `.hpp`, `.hh`, `.hxx` | `C++23` | `code-languages/cpp` |
261
275
  | <img src="https://upload.wikimedia.org/wikipedia/commons/b/bd/Logo_C_sharp.svg" alt="C# logo" width="24" height="24"> | C# | `csharp` | `.cs`, `.csx` | `14` | `code-languages/csharp` |
@@ -276,6 +290,7 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
276
290
  | <img src="https://upload.wikimedia.org/wikipedia/commons/c/c5/Nginx_logo.svg" alt="nginx logo" width="24" height="24"> | nginx | `nginx` | `nginx.conf`, `.nginx`, `.conf` | `1.30.0` | `code-languages/nginx` |
277
291
  | <img src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Apple_logo_grey.svg" alt="Objective-C logo" width="24" height="24"> | Objective-C | `objective-c` | `.m`, `.mm` | `2.0` | `code-languages/objective-c` |
278
292
  | <img src="https://www.php.net/images/logos/new-php-logo.svg" alt="PHP logo" width="24" height="24"> | PHP | `php` | `.php`, `.phtml`, `.php3`, `.php4`, `.php5`, `.phps` | `8.5.6` | `code-languages/php` |
293
+ | <img src="https://upload.wikimedia.org/wikipedia/commons/2/2f/PowerShell_5.0_icon.png" alt="PowerShell logo" width="24" height="24"> | PowerShell | `powershell` | `.ps1`, `.psm1`, `.psd1`, `.ps1xml` | `7.6.1` | `code-languages/powershell` |
279
294
  | <img src="https://commons.wikimedia.org/wiki/Special:FilePath/Python-logo-notext.svg" alt="Python logo" width="24" height="24"> | Python | `python` | `.py`, `.pyw` | `3.14.4` | `code-languages/python` |
280
295
  | <img src="https://www.rust-lang.org/logos/rust-logo-512x512.png" alt="Rust logo" width="24" height="24"> | Rust | `rust` | `.rs` | `1.95.0` | `code-languages/rust` |
281
296
  | <img src="https://sass-lang.com/assets/img/logos/logo.svg" alt="Sass logo" width="24" height="24"> | Sass | `scss` | `.scss`, `.sass` | `1.99.0` | `code-languages/scss` |
package/dist/detect.cjs CHANGED
@@ -1,5 +1,34 @@
1
1
  'use strict';
2
2
 
3
+ // src/languages/assembly.ts
4
+ var assembly = {
5
+ slug: "assembly",
6
+ publishedDate: "1949-01-01",
7
+ extensions: [".asm", ".s", ".S", ".inc"],
8
+ author: "Machine architecture vendors and assembler implementers",
9
+ website: "https://en.wikipedia.org/wiki/Assembly_language",
10
+ paradigms: ["imperative", "low-level", "procedural"],
11
+ tooling: {
12
+ runtimes: ["Native"],
13
+ packageManagers: ["APT", "DNF", "Pacman", "Homebrew"],
14
+ ecosystems: ["Systems", "Embedded", "Reverse Engineering"]
15
+ },
16
+ version: "Architecture-specific",
17
+ logo: "https://cdn.simpleicons.org/assemblyscript/007AAC",
18
+ i18n: {
19
+ en: {
20
+ name: "Assembly",
21
+ description: "A family of low-level languages that map closely to machine instructions for specific CPU architectures.",
22
+ longDescription: "Assembly language represents processor instructions, registers, memory addressing modes, labels, directives, and macros using symbolic text that is assembled into machine code.\n\nIt is used in operating systems, embedded firmware, bootloaders, drivers, reverse engineering, performance-critical routines, and educational material where direct control over hardware and instructions matters."
23
+ },
24
+ es: {
25
+ name: "Assembly",
26
+ description: "Una familia de lenguajes de bajo nivel cercana a instrucciones de maquina para arquitecturas especificas.",
27
+ longDescription: "Assembly representa instrucciones del procesador, registros, modos de direccionamiento de memoria, etiquetas, directivas y macros usando texto simbolico que se ensambla en codigo maquina.\n\nSe usa en sistemas operativos, firmware embebido, bootloaders, drivers, ingenieria inversa, rutinas criticas de rendimiento y material educativo donde importa el control directo del hardware y las instrucciones."
28
+ }
29
+ }
30
+ };
31
+
3
32
  // src/languages/astro.ts
4
33
  var astro = {
5
34
  slug: "astro",
@@ -115,6 +144,35 @@ var cobol = {
115
144
  }
116
145
  };
117
146
 
147
+ // src/languages/coffeescript.ts
148
+ var coffeescript = {
149
+ slug: "coffeescript",
150
+ publishedDate: "2009-12-25",
151
+ extensions: [".coffee", ".litcoffee", ".cson"],
152
+ author: "Jeremy Ashkenas",
153
+ website: "https://coffeescript.org",
154
+ paradigms: ["functional", "imperative", "object-oriented", "scripting"],
155
+ tooling: {
156
+ runtimes: ["Browser", "Node.js"],
157
+ packageManagers: ["npm", "pnpm", "Yarn"],
158
+ ecosystems: ["JavaScript", "Web", "Node.js"]
159
+ },
160
+ version: "2.7.0",
161
+ logo: "https://cdn.simpleicons.org/coffeescript/2F2625",
162
+ i18n: {
163
+ en: {
164
+ name: "CoffeeScript",
165
+ description: "A small language that compiles to JavaScript with concise syntax inspired by Ruby and Python.",
166
+ longDescription: "CoffeeScript adds a concise syntax over JavaScript with significant whitespace, function shortcuts, comprehensions, destructuring, classes, string interpolation, and other expressive conveniences.\n\nIt was widely used in earlier JavaScript application stacks and remains relevant in legacy projects, build pipelines, and codebases that prefer its compact syntax while targeting standard JavaScript."
167
+ },
168
+ es: {
169
+ name: "CoffeeScript",
170
+ description: "Un lenguaje pequeno que compila a JavaScript con sintaxis concisa inspirada en Ruby y Python.",
171
+ longDescription: "CoffeeScript agrega una sintaxis concisa sobre JavaScript con indentacion significativa, atajos para funciones, comprehensions, destructuring, clases, interpolacion de cadenas y otras comodidades expresivas.\n\nFue muy usado en stacks anteriores de aplicaciones JavaScript y sigue siendo relevante en proyectos legacy, pipelines de build y codebases que prefieren su sintaxis compacta mientras generan JavaScript estandar."
172
+ }
173
+ }
174
+ };
175
+
118
176
  // src/languages/cpp.ts
119
177
  var cpp = {
120
178
  slug: "cpp",
@@ -643,6 +701,35 @@ var php = {
643
701
  }
644
702
  };
645
703
 
704
+ // src/languages/powershell.ts
705
+ var powershell = {
706
+ slug: "powershell",
707
+ publishedDate: "2006-11-14",
708
+ extensions: [".ps1", ".psm1", ".psd1", ".ps1xml"],
709
+ author: "Microsoft",
710
+ website: "https://learn.microsoft.com/powershell/",
711
+ paradigms: ["command", "imperative", "object-oriented", "scripting", "shell"],
712
+ tooling: {
713
+ runtimes: ["PowerShell", "Windows PowerShell", ".NET"],
714
+ packageManagers: ["PowerShell Gallery", "PSResourceGet", "PowerShellGet"],
715
+ ecosystems: ["Windows", "Azure", "DevOps", "Automation"]
716
+ },
717
+ version: "7.6.1",
718
+ logo: "https://upload.wikimedia.org/wikipedia/commons/2/2f/PowerShell_5.0_icon.png",
719
+ i18n: {
720
+ en: {
721
+ name: "PowerShell",
722
+ description: "A cross-platform command shell and scripting language for automation and system administration.",
723
+ longDescription: "PowerShell combines a command-line shell, scripting language, object pipeline, module system, providers, remoting, and deep integration with .NET and operating system management APIs.\n\nIt is widely used for Windows administration, Azure automation, DevOps workflows, configuration management, cloud operations, and repeatable infrastructure tasks across Windows, Linux, and macOS."
724
+ },
725
+ es: {
726
+ name: "PowerShell",
727
+ description: "Un shell de comandos y lenguaje de scripting multiplataforma para automatizacion y administracion de sistemas.",
728
+ longDescription: "PowerShell combina un shell de linea de comandos, lenguaje de scripting, pipeline de objetos, sistema de modulos, proveedores, remoting e integracion profunda con .NET y APIs de administracion del sistema operativo.\n\nSe usa ampliamente para administracion de Windows, automatizacion de Azure, flujos DevOps, gestion de configuracion, operaciones cloud y tareas repetibles de infraestructura en Windows, Linux y macOS."
729
+ }
730
+ }
731
+ };
732
+
646
733
  // src/languages/python.ts
647
734
  var python = {
648
735
  slug: "python",
@@ -1007,8 +1094,10 @@ var zsh = {
1007
1094
  // src/catalog.ts
1008
1095
  var languages = [
1009
1096
  astro,
1097
+ assembly,
1010
1098
  bash,
1011
1099
  c,
1100
+ coffeescript,
1012
1101
  cobol,
1013
1102
  cpp,
1014
1103
  csharp,
@@ -1029,6 +1118,7 @@ var languages = [
1029
1118
  nginx,
1030
1119
  objectiveC,
1031
1120
  php,
1121
+ powershell,
1032
1122
  python,
1033
1123
  rust,
1034
1124
  scss,