a simple package to convert value of true to 1, false to 0, and also the otherwise value
npm install true-zero
it is simple, import it and you ready to go
const trueZero = require('true-zero') trueZero(false) // will return 0
or if you want to import it inside a module
import trueZero from 'true-zero ... trueZero(true) // will return 1
you can pass parameter by any type, boolean, string, and integer