{"id":20027,"library":"faster-babel-types","title":"faster-babel-types","description":"faster-babel-types provides a drop-in replacement for @babel/types with optimized runtime performance and TypeScript support. Currently at version 0.1.0, this package is in early active development and is designed for projects that use @babel/types and want faster type checking or creation functions. It maintains the same API surface but aims to improve speed, especially in code paths that extensively use Babel AST types. The main differentiator is performance optimization for Babel plugin authors or tools that process large ASTs. However, it is experimental and not yet stable for production use.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/lxsmnsyc/faster-babel-types","tags":["javascript","pridepack","typescript"],"install":[{"cmd":"npm install faster-babel-types","lang":"bash","label":"npm"},{"cmd":"yarn add faster-babel-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add faster-babel-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; faster-babel-types re-exports and wraps @babel/types functions","package":"@babel/types","optional":false}],"imports":[{"note":"ESM-only; default export provides all types","wrong":"const t = require('faster-babel-types')","symbol":"t","correct":"import t from 'faster-babel-types'"},{"note":"Same named export as @babel/types","wrong":"import { stringLiteral } from '@babel/types'","symbol":"stringLiteral","correct":"import { stringLiteral } from 'faster-babel-types'"},{"note":"ESM-only; also available as t.isStringLiteral","wrong":"const { isStringLiteral } = require('faster-babel-types')","symbol":"isStringLiteral","correct":"import { isStringLiteral } from 'faster-babel-types'"}],"quickstart":{"code":"import t, { stringLiteral, isStringLiteral } from 'faster-babel-types';\n\nconst lit = stringLiteral('hello');\nconsole.log(lit.type); // 'StringLiteral'\nconsole.log(isStringLiteral(lit)); // true\nconsole.log(t.isStringLiteral(lit)); // true\n","lang":"typescript","description":"Shows default import (t) and named imports for creating and checking AST nodes."},"warnings":[{"fix":"Test thoroughly with your Babel plugin or tooling; consider pinning version to avoid unexpected changes.","message":"faster-babel-types is not API compatible with @babel/types for all functions; some optimizations may change behavior in edge cases.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Replace all imports of @babel/types with faster-babel-types.","message":"Never mix imports from @babel/types and faster-babel-types; use exclusively one to avoid type mismatches or performance regressions.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install @babel/types as a dev dependency and use its types if needed; report type issues upstream.","message":"TypeScript types bundled are preliminary and may diverge from @babel/types types; type errors can occur.","severity":"gotcha","affected_versions":">=0.1.0 <0.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install faster-babel-types @babel/types","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'faster-babel-types'"},{"fix":"Use named import: import { stringLiteral } from 'faster-babel-types'.","cause":"Used default import t but function is missing; named export casing may differ.","error":"TypeError: t.stringLiteral is not a function"},{"fix":"Ensure @babel/types is installed as a direct dependency: npm install @babel/types","cause":"Webpack or bundler may not resolve peer dependency correctly; missing @babel/types.","error":"Module not found: Error: Can't resolve 'faster-babel-types'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}