JSPM

babel-plugin-precompile-charcodes

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120
  • Score
    100M100P100Q85364F

Convert character code getters into plain integers

Package Exports

  • babel-plugin-precompile-charcodes

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-precompile-charcodes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-precompile-charcodes Build Status NPM version Dependency Status

Convert character code getters into plain integers.

Install

With npm do:

npm install babel-plugin-precompile-charcodes --save-dev

Example

Convert str.charCodeAt(0) to a plain integer, useful for parsers/tokenizers.

Input

const at = '@'.charCodeAt(0);

Output

const at = 64;

Usage

In your Babel configuration:

{
  "plugins": ["precompile-charcodes"]
}

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs