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.
npm install js-typesVerified import paths — ran on the pinned version, not inferred.
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.
Migrate your import statements from `const jsTypes = require('js-types');` to `import jsTypes from 'js-types';`. Ensure your project's `package.json` has `"type": "module"` or uses `.mjs` file extensions for ESM compatibility.Upgrade your Node.js environment to version 18.20 or later. Use `nvm` or your preferred Node.js version manager to switch versions.
Upgrade your Node.js environment to version 18 or later. For v4.0.0, ensure it's at least 18.20.
Update your import statement from `const jsTypes = require('js-types');` to `import jsTypes from 'js-types';`. Ensure your project configuration supports ES modules (e.g., `"type": "module"` in `package.json`).Always use the full import path for the default export: `import jsTypes from 'js-types';` or specific files like `import typesJson from 'js-types/js-types.json';`.
Refactor your code to use ES module equivalents. For `__dirname`, use `import.meta.url` and `path.dirname(fileURLToPath(import.meta.url))`.
No dependency data recorded yet.