1.0.0 • Published 5 years ago

str_to_bin v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

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];