Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 984 Bytes

README.md

File metadata and controls

47 lines (28 loc) · 984 Bytes

@codewarstools/codewars-languages

A list of programming language identifiers used by the Codewars API.

npm

https://www.npmjs.com/package/@codewarstools/codewars-languages

Installation

npm install @codewarstools/codewars-languages

Usage

import languages from '@codewarstools/codewars-languages';

console.log(languages);

// Output: ['agda', 'bf', 'c', 'cfml', 'clojure', ...]

Example

Check whether a language identifier is included in the list:

import languages from '@codewarstools/codewars-languages';

const language = 'javascript';

if (languages.includes(language)) {
  console.log(`${language} is included in the list.`);
}

TypeScript Support

This package includes TypeScript declarations (languages.d.ts) for type checking and editor support.

The exported array is typed as readonly string[]. The array is also frozen at runtime using Object.freeze().

License

MIT