estree-util-is-identifier-name
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    estree-util-is-identifier-name

    Build Coverage Downloads Size

    Check if something can be an identifier name.

    Install

    This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

    npm:

    npm install estree-util-is-identifier-name

    Use

    import {name, start, cont} from 'estree-util-is-identifier-name'
    
    name('$something69') // => true
    name('69') // => false
    name('var') // => true (this does not handle keywords)
    
    start(48) // => false (character code for `0`)
    cont(48) // => true (character code for `0`)

    API

    This package exports the following identifiers: name, start, and cont. There is no default export.

    name(value)

    Checks if the given string is a valid identifier name.

    start(code)

    Checks if the given character code can start an identifier.

    cont(code)

    Checks if the given character code can continue an identifier.

    Related

    License

    MIT © Titus Wormer

    Install

    npm i estree-util-is-identifier-name

    DownloadsWeekly Downloads

    237,662

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    13.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • wooorm
    • kmck