{"id":16131123,"url":"https://github.com/nerddiffer/all-your-base","last_synced_at":"2025-09-20T22:31:21.485Z","repository":{"id":22023550,"uuid":"25349674","full_name":"NerdDiffer/all-your-base","owner":"NerdDiffer","description":"convert a value from one base to another","archived":false,"fork":false,"pushed_at":"2015-09-16T08:13:36.000Z","size":192,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-23T07:59:32.260Z","etag":null,"topics":[],"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/NerdDiffer.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":"2014-10-17T09:17:43.000Z","updated_at":"2018-02-16T18:39:09.000Z","dependencies_parsed_at":"2022-08-18T08:32:15.188Z","dependency_job_id":null,"html_url":"https://github.com/NerdDiffer/all-your-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NerdDiffer/all-your-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fall-your-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fall-your-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fall-your-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fall-your-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NerdDiffer","download_url":"https://codeload.github.com/NerdDiffer/all-your-base/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fall-your-base/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276169305,"owners_count":25596952,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-09T22:19:17.184Z","updated_at":"2025-09-20T22:31:21.205Z","avatar_url":"https://github.com/NerdDiffer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# All your base\n\nConvert from one base to another\n\n## Installation\n\n`npm install all-your-base`\n\n#### Install as command line tool\n\n`npm link` from your local repo's root. The executable is named `ayb`.\n\n## Usage\n\nUse this in your own scripts and/or as a quick stand-alone command-line tool.\n\n#### From a script\n\n```javascript\nvar ayb = require('all-your-base');\n\n// convert 'abcdef', from base-16 to base-2\nayb.parseInt('abcdef', 16, 2)\n\n// Or directly call the conversion methods\nayb.decToBin(22);\nayb.hexToDec('10000');\n```\n\n#### From command line\n\nFirst, type `npm link` from your local repo's root directory. The executable\nis named `ayb`. Name a method \u0026 space separate your arguments.\n\n```bash\n$ ayb parseInt 65536 10 16\n10000\n$ ayb hexToDec 10000\n65536\n```\n\n---\n\n### Supported bases\n\n| base/radix | name        | module's abbr. |\n|:-----------|:------------|:---------------|\n| base 2     | binary      | `bin`          |\n| base 8     | octal       | `oct`          |\n| base 10    | decimal     | `dec`          |\n| base 16    | hexadecimal | `hex`          |\n\n### List of all operations\n\nHere's an exhaustive list for your reference.\n\n#### `parseInt`\n\nThe native `parseInt` method will let you convert another base to base-10.\nBut the one provided in this module will let you convert to another base. It's\nmerely a wrapper for the other conversion methods.\n\n* `ayb.parseInt(value, fromBase, toBase)`\n  * `value`, String. The value in the base you want to convert.\n  * `fromBase`, Number. Specify the base you are converting from.\n    * If you are using a script \u0026 pass in `undefined`, then it is assumed you\n      are converting from base-10\n  * `toBase`, Number.Specify the base you are converting to.\n    * If you don't pass in anything, then it is assumed you are converting\n      from base-10.\n\nFor the following methods, pass in a numerical as a string.\n\n##### From binary\n\n* `binToDec`\n* `binToHex`\n* `binToOct`\n\n##### From octal\n\n* `octToDec`\n* `octToBin`\n* `octToHex`\n\n##### From decimal\n\n* `decToBin`\n* `decToHex`\n* `decToOct`\n\n##### From hexadecimal\n\n* `hexToDec`\n* `hexToBin`\n* `hexToOct`\n\nThe pattern: `[old]To[New]`  \n`[old]` is the first three letters of the base you are converting from.  \n`[New]` is the first three letters of the base to convert to.\n\nNotice, the function name is lowerCamelCased.\n\n---\n\n### Helpful links\n\nLearn more about different bases.  \n\n* [binary to decimal](http://www.wikihow.com/Convert-Binary-to-Decimal)\n* [binary to hexadecimal](http://www.wikihow.com/Convert-Binary-to-Hexadecimal)\n* [decimal to binary](http://www.wikihow.com/Convert-from-Decimal-to-Binary)\n* [decimal to hexadecimal](http://www.wikihow.com/Convert-from-Decimal-to-Hexadecimal)\n* [hexadecimal to binary or decimal](http://www.wikihow.com/Convert-Hexadecimal-to-Binary-or-Decimal)\n* [how to understand hexadecimal](http://www.wikihow.com/Understand-Hexadecimal)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fall-your-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerddiffer%2Fall-your-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fall-your-base/lists"}