code-languages 1.39.0 → 1.40.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
@@ -238,6 +238,70 @@ no extra data is needed in individual language files.
238
238
  `frontend`, `backend`, and `fullstack` are mutually exclusive; the remaining categories
239
239
  can overlap (Python appears in both `backend` and `data-science`).
240
240
 
241
+ Use `api.paradigm(value)` to filter languages by programming paradigm:
242
+
243
+ ```ts
244
+ import { api, getParadigms } from "code-languages";
245
+
246
+ // Get paradigm metadata
247
+ const info = api.paradigm('functional').info();
248
+ // {
249
+ // slug: 'functional',
250
+ // name: 'Functional',
251
+ // description: 'Computation through function evaluation, immutability, and avoiding side effects.',
252
+ // aliases: ['functional', 'fp', 'pure-functional'],
253
+ // }
254
+
255
+ // Get languages that belong to this paradigm
256
+ const langs = api.paradigm('functional').langs().get();
257
+ const langsEs = api.paradigm('oop').langs().locale('es').get();
258
+ await api.paradigm('object-oriented').langs().load();
259
+
260
+ // Returns undefined / [] for unknown values
261
+ api.paradigm('unknown-xyz').info(); // undefined
262
+ api.paradigm('unknown-xyz').langs().get(); // []
263
+
264
+ // List all available paradigms
265
+ getParadigms();
266
+ ```
267
+
268
+ Supported paradigm aliases include: `functional` / `fp`, `object-oriented` / `oop`,
269
+ `imperative` / `procedural`, `declarative`, `logic`, `concurrent`, `reactive`, `scripting` / `shell`,
270
+ `query`, `markup`, `templating`, `array`, `systems` / `low-level`, `stack-based` / `concatenative`,
271
+ `shader` / `gpu`, and more. Searches `paradigms` on each language.
272
+
273
+ Use `api.ecosystem(value)` to filter languages by technology ecosystem:
274
+
275
+ ```ts
276
+ import { api, getEcosystems } from "code-languages";
277
+
278
+ // Get ecosystem metadata
279
+ const info = api.ecosystem('jvm').info();
280
+ // {
281
+ // slug: 'jvm',
282
+ // name: 'JVM',
283
+ // description: 'Languages that run on the Java Virtual Machine.',
284
+ // aliases: ['jvm', 'java'],
285
+ // }
286
+
287
+ // Get languages that belong to this ecosystem
288
+ const langs = api.ecosystem('jvm').langs().get();
289
+ const langsEs = api.ecosystem('data-science').langs().locale('es').get();
290
+ await api.ecosystem('web').langs().load();
291
+
292
+ // Returns undefined / [] for unknown values
293
+ api.ecosystem('unknown-xyz').info(); // undefined
294
+ api.ecosystem('unknown-xyz').langs().get(); // []
295
+
296
+ // List all available ecosystems
297
+ getEcosystems();
298
+ ```
299
+
300
+ Supported ecosystem aliases include: `web` / `frontend`, `node` / `nodejs`, `jvm` / `java`,
301
+ `dotnet` / `.net`, `data-science` / `ml`, `embedded` / `iot`, `game-dev` / `games`,
302
+ `blockchain` / `web3`, `mobile`, `wasm`, `cloud`, `kubernetes` / `k8s`, `systems`,
303
+ `formal-methods` / `verification`, `gpu` / `graphics`, and more. Searches `tooling.ecosystems` on each language.
304
+
241
305
  Use `localizeLanguage` to read localized display content with English fallback:
242
306
 
243
307
  ```ts
@@ -4,6 +4,14 @@ import { d as Locale, e as LocalizedLanguage } from './types-B0_wjl_Q.js';
4
4
  type LanguageCategory = 'frontend' | 'backend' | 'fullstack' | 'systems' | 'data-science' | 'scripting' | 'other';
5
5
  declare function getCategories(): LanguageCategory[];
6
6
 
7
+ interface EcosystemInfo {
8
+ slug: string;
9
+ name: string;
10
+ description: string;
11
+ aliases: string[];
12
+ }
13
+ declare function getEcosystems(): EcosystemInfo[];
14
+
7
15
  interface PackageManagerInfo {
8
16
  slug: string;
9
17
  name: string;
@@ -14,6 +22,14 @@ interface PackageManagerInfo {
14
22
  }
15
23
  declare function getPackageManagers(): PackageManagerInfo[];
16
24
 
25
+ interface ParadigmInfo {
26
+ slug: string;
27
+ name: string;
28
+ description: string;
29
+ aliases: string[];
30
+ }
31
+ declare function getParadigms(): ParadigmInfo[];
32
+
17
33
  interface RuntimeInfo {
18
34
  slug: string;
19
35
  name: string;
@@ -64,6 +80,18 @@ interface CategoryRequest {
64
80
  /** Languages that belong to this category. */
65
81
  langs(): LanguageCollectionRequest;
66
82
  }
83
+ interface ParadigmRequest {
84
+ /** Metadata about the matched paradigm. Returns undefined for unknown values. */
85
+ info(): ParadigmInfo | undefined;
86
+ /** Languages that use this programming paradigm. */
87
+ langs(): LanguageCollectionRequest;
88
+ }
89
+ interface EcosystemRequest {
90
+ /** Metadata about the matched ecosystem. Returns undefined for unknown values. */
91
+ info(): EcosystemInfo | undefined;
92
+ /** Languages that belong to this ecosystem. */
93
+ langs(): LanguageCollectionRequest;
94
+ }
67
95
  interface LanguageCollectionRequest {
68
96
  /**
69
97
  * Sets the requested locale for every language returned by this collection lookup.
@@ -149,6 +177,28 @@ declare const api: {
149
177
  * await api.category('data-science').langs().load();
150
178
  */
151
179
  category(value: LanguageCategory): CategoryRequest;
180
+ /**
181
+ * Selects every language that uses the given programming paradigm.
182
+ *
183
+ * Accepts common aliases: 'functional', 'fp', 'object-oriented', 'oop', 'declarative', etc.
184
+ * Searches `language.paradigms`.
185
+ *
186
+ * @example
187
+ * api.paradigm('functional').langs().locale('es').get();
188
+ * api.paradigm('oop').info();
189
+ */
190
+ paradigm(value: string): ParadigmRequest;
191
+ /**
192
+ * Selects every language that belongs to the given ecosystem.
193
+ *
194
+ * Accepts common aliases: 'web', 'jvm', 'dotnet', 'devops', 'data-science', 'embedded', etc.
195
+ * Searches `tooling.ecosystems`.
196
+ *
197
+ * @example
198
+ * api.ecosystem('jvm').langs().locale('es').get();
199
+ * api.ecosystem('blockchain').info();
200
+ */
201
+ ecosystem(value: string): EcosystemRequest;
152
202
  /**
153
203
  * Detects every matching language for a filename or path.
154
204
  *
@@ -157,4 +207,4 @@ declare const api: {
157
207
  detectAll(filename: string): LanguageCollectionRequest;
158
208
  };
159
209
 
160
- export { type CategoryRequest as C, type LanguageCategory as L, type PackageManagerInfo as P, type RuntimeInfo as R, api as a, getPackageManagers as b, getRuntimes as c, type LanguageCollectionRequest as d, type LanguageRequest as e, type PackageManagerRequest as f, getCategories as g, type RuntimeRequest as h };
210
+ export { type CategoryRequest as C, type EcosystemInfo as E, type LanguageCategory as L, type PackageManagerInfo as P, type RuntimeInfo as R, type EcosystemRequest as a, type ParadigmInfo as b, type ParadigmRequest as c, api as d, getEcosystems as e, getPackageManagers as f, getCategories as g, getParadigms as h, getRuntimes as i, type LanguageCollectionRequest as j, type LanguageRequest as k, type PackageManagerRequest as l, type RuntimeRequest as m };
@@ -4,6 +4,14 @@ import { d as Locale, e as LocalizedLanguage } from './types-B0_wjl_Q.cjs';
4
4
  type LanguageCategory = 'frontend' | 'backend' | 'fullstack' | 'systems' | 'data-science' | 'scripting' | 'other';
5
5
  declare function getCategories(): LanguageCategory[];
6
6
 
7
+ interface EcosystemInfo {
8
+ slug: string;
9
+ name: string;
10
+ description: string;
11
+ aliases: string[];
12
+ }
13
+ declare function getEcosystems(): EcosystemInfo[];
14
+
7
15
  interface PackageManagerInfo {
8
16
  slug: string;
9
17
  name: string;
@@ -14,6 +22,14 @@ interface PackageManagerInfo {
14
22
  }
15
23
  declare function getPackageManagers(): PackageManagerInfo[];
16
24
 
25
+ interface ParadigmInfo {
26
+ slug: string;
27
+ name: string;
28
+ description: string;
29
+ aliases: string[];
30
+ }
31
+ declare function getParadigms(): ParadigmInfo[];
32
+
17
33
  interface RuntimeInfo {
18
34
  slug: string;
19
35
  name: string;
@@ -64,6 +80,18 @@ interface CategoryRequest {
64
80
  /** Languages that belong to this category. */
65
81
  langs(): LanguageCollectionRequest;
66
82
  }
83
+ interface ParadigmRequest {
84
+ /** Metadata about the matched paradigm. Returns undefined for unknown values. */
85
+ info(): ParadigmInfo | undefined;
86
+ /** Languages that use this programming paradigm. */
87
+ langs(): LanguageCollectionRequest;
88
+ }
89
+ interface EcosystemRequest {
90
+ /** Metadata about the matched ecosystem. Returns undefined for unknown values. */
91
+ info(): EcosystemInfo | undefined;
92
+ /** Languages that belong to this ecosystem. */
93
+ langs(): LanguageCollectionRequest;
94
+ }
67
95
  interface LanguageCollectionRequest {
68
96
  /**
69
97
  * Sets the requested locale for every language returned by this collection lookup.
@@ -149,6 +177,28 @@ declare const api: {
149
177
  * await api.category('data-science').langs().load();
150
178
  */
151
179
  category(value: LanguageCategory): CategoryRequest;
180
+ /**
181
+ * Selects every language that uses the given programming paradigm.
182
+ *
183
+ * Accepts common aliases: 'functional', 'fp', 'object-oriented', 'oop', 'declarative', etc.
184
+ * Searches `language.paradigms`.
185
+ *
186
+ * @example
187
+ * api.paradigm('functional').langs().locale('es').get();
188
+ * api.paradigm('oop').info();
189
+ */
190
+ paradigm(value: string): ParadigmRequest;
191
+ /**
192
+ * Selects every language that belongs to the given ecosystem.
193
+ *
194
+ * Accepts common aliases: 'web', 'jvm', 'dotnet', 'devops', 'data-science', 'embedded', etc.
195
+ * Searches `tooling.ecosystems`.
196
+ *
197
+ * @example
198
+ * api.ecosystem('jvm').langs().locale('es').get();
199
+ * api.ecosystem('blockchain').info();
200
+ */
201
+ ecosystem(value: string): EcosystemRequest;
152
202
  /**
153
203
  * Detects every matching language for a filename or path.
154
204
  *
@@ -157,4 +207,4 @@ declare const api: {
157
207
  detectAll(filename: string): LanguageCollectionRequest;
158
208
  };
159
209
 
160
- export { type CategoryRequest as C, type LanguageCategory as L, type PackageManagerInfo as P, type RuntimeInfo as R, api as a, getPackageManagers as b, getRuntimes as c, type LanguageCollectionRequest as d, type LanguageRequest as e, type PackageManagerRequest as f, getCategories as g, type RuntimeRequest as h };
210
+ export { type CategoryRequest as C, type EcosystemInfo as E, type LanguageCategory as L, type PackageManagerInfo as P, type RuntimeInfo as R, type EcosystemRequest as a, type ParadigmInfo as b, type ParadigmRequest as c, api as d, getEcosystems as e, getPackageManagers as f, getCategories as g, getParadigms as h, getRuntimes as i, type LanguageCollectionRequest as j, type LanguageRequest as k, type PackageManagerRequest as l, type RuntimeRequest as m };