force-bool

Parse environment variable to a boolean

Usage no npm install needed!

<script type="module">
  import forceBool from 'https://cdn.skypack.dev/force-bool';
</script>

README

Parse environment variable to a boolean

import forceBool from 'force-bool'

const nodeEnv = forceBool('SOME_FEATURE')
// => true if 'true', false if 'false' or not set