JavaScript Built-in Types List

4.0.0 · active · verified Sun Apr 19

The `js-types` package provides a comprehensive, programmatically accessible list of built-in JavaScript data types, primarily sourced from MDN Web Docs. It is currently at stable version 4.0.0, which requires Node.js 18.20 and is a pure ESM package. The package maintains a moderate release cadence, with major versions often coinciding with significant Node.js LTS updates and new ECMAScript feature adoptions. Its key differentiator lies in its straightforward design: the core data is simply a `js-types.json` file that can be directly imported, making it highly portable and easy to integrate across various JavaScript environments—from Node.js backend services to browser-side applications—without introducing complex dependencies. This makes it an ideal utility for tasks like runtime type checking, generating documentation, or any scenario requiring a definitive, up-to-date enumeration of JavaScript's fundamental types.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import the list of JavaScript types and perform basic operations, such as listing all types and checking for the presence of a specific type. This highlights the primary use case of accessing the array of type names.

import jsTypes from 'js-types';

console.log('--- All JavaScript Built-in Types ---');
console.log(`Total types found: ${jsTypes.length}`);
console.log(jsTypes.join(', '));

// Example: Check if a specific type is in the list
const typeToCheck = 'Map';
if (jsTypes.includes(typeToCheck)) {
  console.log(`\n'${typeToCheck}' is a recognized JavaScript built-in type.`);
} else {
  console.log(`\n'${typeToCheck}' is NOT in the list of JavaScript built-in types.`);
}

view raw JSON →