Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/babel-utils/babel-identifiers
Classify Babel identifiers
https://github.com/babel-utils/babel-identifiers
babel babel-util flow identifiers
Last synced: about 3 hours ago
JSON representation
Classify Babel identifiers
- Host: GitHub
- URL: https://github.com/babel-utils/babel-identifiers
- Owner: babel-utils
- License: other
- Created: 2017-06-05T23:28:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T21:34:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T21:51:32.983Z (25 days ago)
- Topics: babel, babel-util, flow, identifiers
- Language: JavaScript
- Homepage:
- Size: 245 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-identifiers
> Classify Babel identifiers
### Installation
```sh
yarn add babel-identifiers
```### Usage
Identifier nodes fall into one of three kinds:
1. "binding" - `let binding = ...`
2. "reference" - `reference;`
3. "static" - `a.static`And into one of four grammars:
1. "javascript" - `let javascript = ...`
1. "jsx" - ``
2. "flow" - `({}: flow)`
3. "typescript" - `enum typescript {}````js
import {getIdentifierKind, getIdentifierGrammar} from 'babel-identifiers';isIdentifierLike(path); // true | false
getIdentifierKind(path); // "binding" | "reference" | "static"
getIdentifierGrammar(path); // "javascript" | "flow" | "typescript"
```