1 | [npm]: https://img.shields.io/npm/v/@jsep-plugin/numbers
|
2 | [npm-url]: https://www.npmjs.com/package/@jsep-plugin/numbers
|
3 | [size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/numbers
|
4 | [size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/numbers
|
5 |
|
6 | [![npm][npm]][npm-url]
|
7 | [![size][size]][size-url]
|
8 |
|
9 | # @jsep-plugin/numbers
|
10 |
|
11 | A JSEP plugin for adding support for additional number formats, hexadecimal, binary and octal.
|
12 | It also adds support to ignore _ characters in numbers
|
13 |
|
14 | ```javascript
|
15 | jsep('0xA'); // hexadecimal (10)
|
16 | jsep('0b01001010'); // binary (74)
|
17 | jsep('0644'); // octal (420)
|
18 | jsep('0o644'); // octal (420)
|
19 | jsep('115_200'); // decimal (115200)
|
20 | ```
|
21 |
|
22 | ## Install
|
23 |
|
24 | ```console
|
25 | npm install @jsep-plugin/numbers
|
26 | # or
|
27 | yarn add @jsep-plugin/numbers
|
28 | ```
|
29 |
|
30 | ## Usage
|
31 | ```javascript
|
32 | import jsep from 'jsep';
|
33 | import jsepNumbers from '@jsep-plugin/numbers';
|
34 | jsep.plugins.register(jsepNumbers);
|
35 | ```
|
36 |
|
37 | ## Meta
|
38 |
|
39 | [LICENSE (MIT)](/LICENSE)
|