
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@reflexions/string-to-boolean
Advanced tools
Converts strings to booleans, treating '0', 'false', and 'off' as false
Converts strings to booleans, treating '0', 'false', and 'off' as false. Useful for environment variables and form inputs.
npm install @reflexions/string-to-boolean
import stringToBoolean from '@reflexions/string-to-boolean';
stringToBoolean('true') // true
stringToBoolean('1') // true
stringToBoolean('false') // false
stringToBoolean('0') // false
stringToBoolean('') // false
| Input | Output | Notes |
|---|---|---|
true / false | true / false | Booleans pass through unchanged |
'true', 'TRUE', 'True' | true | Case-insensitive |
'false', 'FALSE', 'False' | false | Case-insensitive |
'1', 'yes', 'on', 'anything' | true | Any non-empty, non-falsy string |
'0' | false | |
'off', 'OFF' | false | Case-insensitive |
'' | false | Empty string |
null, undefined | false |
FAQs
Converts strings to booleans, treating '0', 'false', and 'off' as false
We found that @reflexions/string-to-boolean demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.