Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
isIdentifierLike
✓ import { isIdentifierLike } from 'babel-identifiers'
✗ const { isIdentifierLike } = require('babel-identifiers')
Package uses named exports only; default import will not work. For CJS, use require('babel-identifiers').isIdentifierLike.
getIdentifierKind
✓ import { getIdentifierKind } from 'babel-identifiers'
Returns 'binding', 'reference', or 'static'. Works with any Babel NodePath to an Identifier.
getIdentifierGrammar
✓ import { getIdentifierGrammar } from 'babel-identifiers'
Returns 'javascript', 'jsx', 'flow', or 'typescript'. Determines grammar from ancestor nodes.
Demonstrates classifying identifiers by type and grammar using Babel parser and traverse.
import { isIdentifierLike, getIdentifierKind, getIdentifierGrammar } from 'babel-identifiers';
import { parse } from '@babel/parser';
import traverse from '@babel/traverse';
const code = `let x = 1; x; <jsx/>; ({y}: number);`;
const ast = parse(code, { sourceType: 'module', plugins: ['jsx', 'typescript', 'flow'] });
traverse(ast, {
Identifier(path) {
if (isIdentifierLike(path)) {
const kind = getIdentifierKind(path);
const grammar = getIdentifierGrammar(path);
console.log(path.node.name, kind, grammar);
}
}
});
Errors
Common errors & fixes
Cannot find module 'babel-identifiers'
Package not installed or missing from dependencies.
fixRun: npm install babel-identifiers
TypeError: getIdentifierKind is not a function
Importing incorrectly (e.g., default import instead of named).
fixUse named import: import { getIdentifierKind } from 'babel-identifiers' Argument passed to getIdentifierKind is not a NodePath
Passing a raw AST node instead of a Babel NodePath.
fixEnsure you're inside a visitor callback with 'path' argument, or wrap node with NodePath.
Audit
Dependencies
No dependency data recorded yet.