Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

acorn-numeric-separator

acornjs192.2kMITdeprecated0.3.6

acorn>=7.4 supports numeric separators

Support for numeric separators in acorn

readme

Numeric separator support for Acorn

NPM version

This is a plugin for Acorn - a tiny, fast JavaScript parser, written completely in JavaScript.

It implements support for numeric separators as defined in the stage 3 proposal Numeric Separators.

Usage

This module provides a plugin that can be used to extend the Acorn Parser class to parse numeric separators. You can either choose to use it via CommonJS (for example in Node.js) like this

const {Parser} = require('acorn');
const numericSeparator = require('acorn-numeric-separator');
Parser.extend(numericSeparator).parse('100_000');

or as an ECMAScript module like this:

import {Parser} from 'acorn';
import numericSeparator from 'acorn-numeric-separator';
Parser.extend(numericSeparator).parse('100_000');

License

This plugin is released under an MIT License.

changelog

0.3.6 (2020-08-13)

  • Mark as compatible with acorn@8

0.3.5 (2020-08-13)

  • Actually include ESM files in release

0.3.3 (2020-06-13)

  • Migrate to ESM

0.3.2 (2020-05-06)

  • Also remove numeric separators in Literal's bigint property

0.3.1 (2020-05-03)

  • Make compatible with acorn's bigint support
  • Mark as compatible with acorn@7

0.3.0 (2019-04-04)

  • Make compatible with acorn-bigint

0.2.0 (2018-09-14)

  • Update to new acorn 6 interface
  • Change license to MIT

0.1.1 (2018-01-16)

  • Don't bail on empty integers as in 1.

0.1.0 (2017-12-19)

Initial release