1.0.0 • Published 5 years ago
str_to_bin v1.0.0
A small package to transform a positive decimal number into a binary string or array.
Install
npm i str_to_bin
Test
npm test
How to use
const { strToBin } = require('str_to_bin');
const bin = strToBin('5');
console.log(bin); // '101'
const arrBin = strToBin('5', 1);
console.log(arrBin); // [1, 0, 1];
1.0.0
5 years ago