0.0.0 • Published 4 years ago
0b v0.0.0
0b
A JavaScript binary number parser; accepts a string or a numeric value.
Node.js's support for ECMAScript 2015(ES6) binary literals(0b
)
4.3.2 and above | 0.12.16 | 0.10.47 and below |
---|---|---|
Supported | Supported(with harmony flag) | Unsupported |
Features
- Works well on both web browsers and Node.js
- No dependency
Example
var Ob = require("0b")(true);
// If `notational` is true,
// NaN and infinite values are not allowed;
// otherwise, they are allowed.
console.log("0b11110011", Ob(11110011)); // 243