{"id":15814200,"url":"https://github.com/stevenvachon/parse-string-boolean","last_synced_at":"2026-04-28T11:31:38.265Z","repository":{"id":54301201,"uuid":"123185605","full_name":"stevenvachon/parse-string-boolean","owner":"stevenvachon","description":"Parse a string representation of a boolean.","archived":false,"fork":false,"pushed_at":"2020-06-02T09:08:01.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T04:03:18.497Z","etag":null,"topics":["boolean","html","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevenvachon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T20:38:46.000Z","updated_at":"2024-03-27T14:26:50.000Z","dependencies_parsed_at":"2022-08-13T11:20:58.834Z","dependency_job_id":null,"html_url":"https://github.com/stevenvachon/parse-string-boolean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fparse-string-boolean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fparse-string-boolean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fparse-string-boolean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fparse-string-boolean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/parse-string-boolean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385390,"owners_count":20768671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boolean","html","nodejs"],"created_at":"2024-10-05T04:23:31.245Z","updated_at":"2026-04-28T11:31:33.222Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-string-boolean [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]\n\n\u003e Parse a string representation of a boolean.\n\n* Parses \"true\" as `true`\n* Parses \"false\" as `false`\n* Case-insensitive\n* Ignores leading and trailing whitespace\n* Returns `null` (customizable) if the string does not represent a boolean\n* **Throws an error if input is not a string**\n\n\n## Installation\n\n[Node.js](http://nodejs.org/) `\u003e= 6` is required. To install, type this at the command line:\n```shell\nnpm install parse-string-boolean\n```\n\n\n## Usage\n\n`parseBoolean(string[, defaultValue])`\n\n```js\nconst parseBoolean = require('parse-string-boolean');\n\nparseBoolean('true');  //-\u003e true\nparseBoolean(' TRUE ');  //-\u003e true\nparseBoolean('false');  //-\u003e false\n\nparseBoolean('yes');  //-\u003e null\nparseBoolean('1');  //-\u003e null\nparseBoolean('');  //-\u003e null\n```\n\nOptionally, you can override the default value for strings that do not represent a boolean:\n```js\nparseBoolean('', true);  //-\u003e true\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/parse-string-boolean.svg\n[npm-url]: https://npmjs.com/package/parse-string-boolean\n[travis-image]: https://img.shields.io/travis/stevenvachon/parse-string-boolean.svg\n[travis-url]: https://travis-ci.org/stevenvachon/parse-string-boolean\n[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/parse-string-boolean.svg\n[greenkeeper-url]: https://greenkeeper.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fparse-string-boolean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Fparse-string-boolean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fparse-string-boolean/lists"}