{"id":20780135,"url":"https://github.com/xotic750/parse-int-x","last_synced_at":"2025-04-30T20:09:54.693Z","repository":{"id":25668230,"uuid":"105323230","full_name":"Xotic750/parse-int-x","owner":"Xotic750","description":"Parses a string argument and returns an integer of the specified radix.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:54:29.000Z","size":2178,"stargazers_count":0,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T20:09:48.314Z","etag":null,"topics":["browser","javascript","nodejs","parseint"],"latest_commit_sha":null,"homepage":null,"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/Xotic750.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":"2017-09-29T22:47:18.000Z","updated_at":"2020-01-30T12:28:47.000Z","dependencies_parsed_at":"2023-01-14T03:04:53.817Z","dependency_job_id":null,"html_url":"https://github.com/Xotic750/parse-int-x","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fparse-int-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fparse-int-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fparse-int-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xotic750%2Fparse-int-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xotic750","download_url":"https://codeload.github.com/Xotic750/parse-int-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251774896,"owners_count":21641731,"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":["browser","javascript","nodejs","parseint"],"created_at":"2024-11-17T13:32:28.225Z","updated_at":"2025-04-30T20:09:54.672Z","avatar_url":"https://github.com/Xotic750.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca\n  href=\"https://travis-ci.org/Xotic750/parse-int-x\"\n  title=\"Travis status\"\u003e\n\u003cimg\n  src=\"https://travis-ci.org/Xotic750/parse-int-x.svg?branch=master\"\n  alt=\"Travis status\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://david-dm.org/Xotic750/parse-int-x\"\n  title=\"Dependency status\"\u003e\n\u003cimg src=\"https://david-dm.org/Xotic750/parse-int-x/status.svg\"\n  alt=\"Dependency status\" height=\"18\"/\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://david-dm.org/Xotic750/parse-int-x?type=dev\"\n  title=\"devDependency status\"\u003e\n\u003cimg src=\"https://david-dm.org/Xotic750/parse-int-x/dev-status.svg\"\n  alt=\"devDependency status\" height=\"18\"/\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://badge.fury.io/js/parse-int-x\"\n  title=\"npm version\"\u003e\n\u003cimg src=\"https://badge.fury.io/js/parse-int-x.svg\"\n  alt=\"npm version\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://www.jsdelivr.com/package/npm/parse-int-x\"\n  title=\"jsDelivr hits\"\u003e\n\u003cimg src=\"https://data.jsdelivr.com/v1/package/npm/parse-int-x/badge?style=rounded\"\n  alt=\"jsDelivr hits\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://bettercodehub.com/results/Xotic750/parse-int-x\"\n  title=\"bettercodehub score\"\u003e\n\u003cimg src=\"https://bettercodehub.com/edge/badge/Xotic750/parse-int-x?branch=master\"\n  alt=\"bettercodehub score\" height=\"18\"\u003e\n\u003c/a\u003e\n\u003ca\n  href=\"https://coveralls.io/github/Xotic750/parse-int-x?branch=master\"\n  title=\"Coverage Status\"\u003e\n\u003cimg src=\"https://coveralls.io/repos/github/Xotic750/parse-int-x/badge.svg?branch=master\"\n  alt=\"Coverage Status\" height=\"18\"\u003e\n\u003c/a\u003e\n\n\u003ca name=\"module_parse-int-x\"\u003e\u003c/a\u003e\n\n## parse-int-x\n\nParses a string argument and returns an integer of the specified radix.\n\n### `module.exports(string, number)` ⇒ \u003ccode\u003enumber\u003c/code\u003e ⏏\n\n\u003ca name=\"module_parse-int-x\"\u003e\u003c/a\u003e\n\n### `parse-int-x` ⇒ \u003ccode\u003enumber\u003c/code\u003e\n\nThis method parses a string argument and returns an integer of the specified\nradix (the base in mathematical numeral systems). (ES2019)\n\n**Kind**: static property of [\u003ccode\u003eparse-int-x\u003c/code\u003e](#module_parse-int-x)  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - An integer number parsed from the given string. If the first\ncharacter cannot be converted to a number, NaN is returned.  \n**Throws**:\n\n- \u003ccode\u003eTypeError\u003c/code\u003e If target is a Symbol or is not coercible.\n\n| Param  | Type                | Description                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| ------ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| string | \u003ccode\u003estring\u003c/code\u003e | The value to parse. If the string argument is not a string, then it is converted to a string (using the ToString abstract operation). Leading whitespace in the string argument is ignored.                                                                                                                                                                                                                                  |\n| radix  | \u003ccode\u003enumber\u003c/code\u003e | An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the above mentioned string. Specify 10 for the decimal numeral system commonly used by humans. Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified, usually defaulting the value to 10. |\n\n**Example**\n\n```js\nimport $parseInt from 'parse-int-x';\n\n// The following examples all return 15\nconsole.log($parseInt(' 0xF', 16));\nconsole.log($parseInt(' F', 16));\nconsole.log($parseInt('17', 8));\nconsole.log($parseInt(021, 8));\nconsole.log($parseInt('015', 10)); // $parseInt(015, 10); will return 15\nconsole.log($parseInt(15.99, 10));\nconsole.log($parseInt('15,123', 10));\nconsole.log($parseInt('FXX123', 16));\nconsole.log($parseInt('1111', 2));\nconsole.log($parseInt('15 * 3', 10));\nconsole.log($parseInt('15e2', 10));\nconsole.log($parseInt('15px', 10));\nconsole.log($parseInt('12', 13));\n\n//The following examples all return NaN:\nconsole.log($parseInt('Hello', 8)); // Not a number at all\nconsole.log($parseInt('546', 2)); // Digits are not valid for binary representations\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxotic750%2Fparse-int-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxotic750%2Fparse-int-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxotic750%2Fparse-int-x/lists"}