code-languages 1.4.3 → 1.5.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 +11 -1
- package/dist/detect.cjs +60 -0
- package/dist/detect.cjs.map +1 -1
- package/dist/detect.js +60 -0
- package/dist/detect.js.map +1 -1
- package/dist/index.cjs +62 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +61 -1
- package/dist/index.js.map +1 -1
- package/dist/languages/assembly.cjs +34 -0
- package/dist/languages/assembly.cjs.map +1 -0
- package/dist/languages/assembly.d.cts +29 -0
- package/dist/languages/assembly.d.ts +29 -0
- package/dist/languages/assembly.js +32 -0
- package/dist/languages/assembly.js.map +1 -0
- package/dist/languages/powershell.cjs +34 -0
- package/dist/languages/powershell.cjs.map +1 -0
- package/dist/languages/powershell.d.cts +29 -0
- package/dist/languages/powershell.d.ts +29 -0
- package/dist/languages/powershell.js +32 -0
- package/dist/languages/powershell.js.map +1 -0
- package/package.json +11 -1
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
|
|
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 38 languages.
|
|
12
12
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
@@ -45,6 +45,7 @@ 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";
|
|
50
51
|
import { cobol } from "code-languages/cobol";
|
|
@@ -65,6 +66,7 @@ import { markdown } from "code-languages/markdown";
|
|
|
65
66
|
import { nginx } from "code-languages/nginx";
|
|
66
67
|
import { objectiveC } from "code-languages/objective-c";
|
|
67
68
|
import { php } from "code-languages/php";
|
|
69
|
+
import { powershell } from "code-languages/powershell";
|
|
68
70
|
import { python } from "code-languages/python";
|
|
69
71
|
import { scss } from "code-languages/scss";
|
|
70
72
|
import { json } from "code-languages/json";
|
|
@@ -79,6 +81,7 @@ import { yaml } from "code-languages/yaml";
|
|
|
79
81
|
import { zsh } from "code-languages/zsh";
|
|
80
82
|
|
|
81
83
|
console.log(astro.version);
|
|
84
|
+
console.log(assembly.extensions);
|
|
82
85
|
console.log(bash.version);
|
|
83
86
|
console.log(c.extensions);
|
|
84
87
|
console.log(cpp.i18n.en.name);
|
|
@@ -97,6 +100,7 @@ console.log(markdown.website);
|
|
|
97
100
|
console.log(nginx.version);
|
|
98
101
|
console.log(objectiveC.version);
|
|
99
102
|
console.log(php.version);
|
|
103
|
+
console.log(powershell.extensions);
|
|
100
104
|
console.log(python.publishedDate);
|
|
101
105
|
console.log(scss.extensions);
|
|
102
106
|
console.log(json.i18n.en.description);
|
|
@@ -116,6 +120,7 @@ Import from the package root when bundle size is not a concern:
|
|
|
116
120
|
```ts
|
|
117
121
|
import {
|
|
118
122
|
astro,
|
|
123
|
+
assembly,
|
|
119
124
|
bash,
|
|
120
125
|
c,
|
|
121
126
|
cpp,
|
|
@@ -138,6 +143,7 @@ import {
|
|
|
138
143
|
nginx,
|
|
139
144
|
objectiveC,
|
|
140
145
|
php,
|
|
146
|
+
powershell,
|
|
141
147
|
rust,
|
|
142
148
|
scss,
|
|
143
149
|
sql,
|
|
@@ -153,6 +159,7 @@ import {
|
|
|
153
159
|
} from "code-languages";
|
|
154
160
|
|
|
155
161
|
console.log(localizeLanguage(astro, "es").description);
|
|
162
|
+
console.log(localizeLanguage(assembly).description);
|
|
156
163
|
console.log(detectLanguage("src/index.ts")?.slug);
|
|
157
164
|
console.log(detectLanguages("include/config.h").map((language) => language.slug));
|
|
158
165
|
console.log(localizeLanguage(bash, "es").description);
|
|
@@ -172,6 +179,7 @@ console.log(markdown.extensions);
|
|
|
172
179
|
console.log(localizeLanguage(nginx, "es").description);
|
|
173
180
|
console.log(objectiveC.extensions);
|
|
174
181
|
console.log(localizeLanguage(php, "es").description);
|
|
182
|
+
console.log(localizeLanguage(powershell).name);
|
|
175
183
|
console.log(go.logo);
|
|
176
184
|
console.log(localizeLanguage(scss).name);
|
|
177
185
|
console.log(json.website);
|
|
@@ -254,6 +262,7 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
|
|
|
254
262
|
| Logo | Language | Slug | Extensions | Version | Import |
|
|
255
263
|
|---|---|---|---|---|---|
|
|
256
264
|
| <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` |
|
|
265
|
+
| <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
266
|
| <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
267
|
| <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` |
|
|
259
268
|
| <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` |
|
|
@@ -276,6 +285,7 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
|
|
|
276
285
|
| <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
286
|
| <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
287
|
| <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` |
|
|
288
|
+
| <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
289
|
| <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
290
|
| <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
291
|
| <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",
|
|
@@ -643,6 +672,35 @@ var php = {
|
|
|
643
672
|
}
|
|
644
673
|
};
|
|
645
674
|
|
|
675
|
+
// src/languages/powershell.ts
|
|
676
|
+
var powershell = {
|
|
677
|
+
slug: "powershell",
|
|
678
|
+
publishedDate: "2006-11-14",
|
|
679
|
+
extensions: [".ps1", ".psm1", ".psd1", ".ps1xml"],
|
|
680
|
+
author: "Microsoft",
|
|
681
|
+
website: "https://learn.microsoft.com/powershell/",
|
|
682
|
+
paradigms: ["command", "imperative", "object-oriented", "scripting", "shell"],
|
|
683
|
+
tooling: {
|
|
684
|
+
runtimes: ["PowerShell", "Windows PowerShell", ".NET"],
|
|
685
|
+
packageManagers: ["PowerShell Gallery", "PSResourceGet", "PowerShellGet"],
|
|
686
|
+
ecosystems: ["Windows", "Azure", "DevOps", "Automation"]
|
|
687
|
+
},
|
|
688
|
+
version: "7.6.1",
|
|
689
|
+
logo: "https://upload.wikimedia.org/wikipedia/commons/2/2f/PowerShell_5.0_icon.png",
|
|
690
|
+
i18n: {
|
|
691
|
+
en: {
|
|
692
|
+
name: "PowerShell",
|
|
693
|
+
description: "A cross-platform command shell and scripting language for automation and system administration.",
|
|
694
|
+
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."
|
|
695
|
+
},
|
|
696
|
+
es: {
|
|
697
|
+
name: "PowerShell",
|
|
698
|
+
description: "Un shell de comandos y lenguaje de scripting multiplataforma para automatizacion y administracion de sistemas.",
|
|
699
|
+
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."
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
|
|
646
704
|
// src/languages/python.ts
|
|
647
705
|
var python = {
|
|
648
706
|
slug: "python",
|
|
@@ -1007,6 +1065,7 @@ var zsh = {
|
|
|
1007
1065
|
// src/catalog.ts
|
|
1008
1066
|
var languages = [
|
|
1009
1067
|
astro,
|
|
1068
|
+
assembly,
|
|
1010
1069
|
bash,
|
|
1011
1070
|
c,
|
|
1012
1071
|
cobol,
|
|
@@ -1029,6 +1088,7 @@ var languages = [
|
|
|
1029
1088
|
nginx,
|
|
1030
1089
|
objectiveC,
|
|
1031
1090
|
php,
|
|
1091
|
+
powershell,
|
|
1032
1092
|
python,
|
|
1033
1093
|
rust,
|
|
1034
1094
|
scss,
|