{"_id":"is-base64","_rev":"324059","name":"is-base64","description":"Predicate that returns true if base64 string.","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"time":{"modified":"2021-06-04T01:50:45.000Z","created":"2015-05-15T22:19:31.937Z","1.1.0":"2020-03-04T00:03:45.131Z","1.0.0":"2019-08-31T18:50:31.102Z","0.1.0":"2018-10-26T05:42:00.202Z","0.0.6":"2018-07-24T23:21:59.999Z","0.0.5":"2018-06-01T03:18:09.014Z","0.0.4":"2017-06-20T23:42:03.256Z","0.0.3":"2017-06-20T23:34:56.056Z","0.0.2":"2016-11-18T21:56:42.124Z","0.0.1":"2015-05-15T22:19:31.937Z"},"users":{},"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"versions":{"1.1.0":{"name":"is-base64","version":"1.1.0","description":"Predicate that returns true if base64 string.","main":"is-base64.js","bin":{"is-base64":"bin/is-base64","is_base64":"bin/is-base64"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64","mime"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^4.9.1"},"gitHead":"d50ec27f0eb22b74c7c04c3374713d88b75d778a","_id":"is-base64@1.1.0","_nodeVersion":"11.15.0","_npmVersion":"6.7.0","dist":{"shasum":"8ce1d719895030a457c59a7dcaf39b66d99d56b4","size":3888,"noattachment":false,"key":"/is-base64/-/is-base64-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-1.1.0.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64_1.1.0_1583280225008_0.8448604806805406"},"_hasShrinkwrap":false,"publish_time":1583280225131,"_cnpm_publish_time":1583280225131},"1.0.0":{"name":"is-base64","version":"1.0.0","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64","mime"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^4.9.1"},"gitHead":"5b76a1adeaac43f3e4384f83624ff46c3bb5fb6b","_id":"is-base64@1.0.0","_nodeVersion":"11.15.0","_npmVersion":"6.7.0","dist":{"shasum":"0bdda1a758fcfac6d78df8bb95960512bb42db61","size":3531,"noattachment":false,"key":"/is-base64/-/is-base64-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-1.0.0.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64_1.0.0_1567277430923_0.9860801097178018"},"_hasShrinkwrap":false,"publish_time":1567277431102,"_cnpm_publish_time":1567277431102},"0.1.0":{"name":"is-base64","version":"0.1.0","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64","mime"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^4.9.1"},"gitHead":"463d91f1654c72d364c69bfb806ff0569018664f","_id":"is-base64@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.10.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"a6f20610c6ef4863a51cba32bc0222544b932622","size":3348,"noattachment":false,"key":"/is-base64/-/is-base64-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.1.0.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64_0.1.0_1540532519923_0.9364254017144142"},"_hasShrinkwrap":false,"publish_time":1540532520202,"_cnpm_publish_time":1540532520202},"0.0.6":{"name":"is-base64","version":"0.0.6","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^3.0.3"},"gitHead":"027b98246efc7c7f60dab3254221c78631128805","_id":"is-base64@0.0.6","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"8ee4a3e1f4cbec2a643385705be5c81885347114","size":3158,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.6.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64_0.0.6_1532474519928_0.263760051256861"},"_hasShrinkwrap":false,"publish_time":1532474519999,"_cnpm_publish_time":1532474519999},"0.0.5":{"name":"is-base64","version":"0.0.5","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^3.0.3"},"gitHead":"60cfd9b6038e8095dc61098b5967a085a2987656","_id":"is-base64@0.0.5","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"39ecd12e937c667edd3b17fa677036825483b477","size":3164,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.5.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64_0.0.5_1527823088938_0.04792074918203393"},"_hasShrinkwrap":false,"publish_time":1527823089014,"_cnpm_publish_time":1527823089014},"0.0.4":{"name":"is-base64","version":"0.0.4","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^3.0.3"},"gitHead":"777439af742d93933b226606238843716b5a6292","_id":"is-base64@0.0.4","_shasum":"6ef33c01f4870d1306ea38857bd59adf3e3f543f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"6ef33c01f4870d1306ea38857bd59adf3e3f543f","size":3745,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.4.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64-0.0.4.tgz_1498002122264_0.7074176075402647"},"publish_time":1498002123256,"_hasShrinkwrap":false,"_cnpm_publish_time":1498002123256},"0.0.3":{"name":"is-base64","version":"0.0.3","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^3.0.3"},"gitHead":"da14e6d54e530bed8c8c59b7753dc0c4e5c23658","_id":"is-base64@0.0.3","_shasum":"9214a3e4e9e8eb2335c8007cc60f62b47e28e5fa","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"9214a3e4e9e8eb2335c8007cc60f62b47e28e5fa","size":3740,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.3.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-base64-0.0.3.tgz_1498001695116_0.2965676891617477"},"publish_time":1498001696056,"_hasShrinkwrap":false,"_cnpm_publish_time":1498001696056},"0.0.2":{"name":"is-base64","version":"0.0.2","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/miguelmota/is-base64.git"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","devDependencies":{"tape":"^3.0.3"},"gitHead":"98da45d388340b32a489f04d1869ff048cdc0581","_id":"is-base64@0.0.2","_shasum":"9dbb04271a121bd8f4cc1f988281daef1f60f630","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"dist":{"shasum":"9dbb04271a121bd8f4cc1f988281daef1f60f630","size":3627,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.2.tgz"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/is-base64-0.0.2.tgz_1479506201519_0.7490920266136527"},"publish_time":1479506202124,"_cnpm_publish_time":1479506202124,"_hasShrinkwrap":false},"0.0.1":{"name":"is-base64","version":"0.0.1","description":"Predicate that returns true if base64 string.","main":"is-base64.js","directories":{"test":"test"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"https://github.com/miguelmota/is-base64"},"keywords":["predicate","base64"],"author":{"name":"Miguel Mota","email":"hello@miguelmota.com","url":"http://www.miguelmota.com/"},"license":"MIT","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"homepage":"https://github.com/miguelmota/is-base64","dependencies":{"tape":"^3.0.3"},"gitHead":"f444eaccc91e25492598926541dd1d2ea94d83d5","_id":"is-base64@0.0.1","_shasum":"7660341052471b69a3098a25d803310fffe0c227","_from":".","_npmVersion":"2.7.3","_nodeVersion":"0.12.0","_npmUser":{"name":"miguelmota","email":"hello@miguelmota.com"},"maintainers":[{"name":"miguelmota","email":"hello@miguelmota.com"}],"dist":{"shasum":"7660341052471b69a3098a25d803310fffe0c227","size":3140,"noattachment":false,"key":"/is-base64/-/is-base64-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-base64/download/is-base64-0.0.1.tgz"},"publish_time":1431728371937,"_cnpm_publish_time":1431728371937,"_hasShrinkwrap":false}},"readme":"# is-base64\n\n> Predicate that returns true if [base64](https://en.wikipedia.org/wiki/Base64) string.\n\n## Install\n\n```bash\nnpm install is-base64\n```\n\n## Usage\n\n```javascript\nvar isBase64 = require('is-base64');\n\nvar string = 'iVBORw0KGgoAAAAN ... kSuQmCC';\nvar stringWithMime = 'data:image/png;base64,iVBORw0KGgoAAAA ... AAElFTkSuQmCC';\n\nconsole.log(isBase64(string)); // true\nconsole.log(isBase64(stringWithMime)); // false\nconsole.log(isBase64(stringWithMime, {allowMime: true})); // true\nconsole.log(isBase64(string, {mimeRequired: true})); // false\nconsole.log(isBase64(stringWithMime, {mimeRequired: true})); // true\nconsole.log(isBase64('1342234')); // false\nconsole.log(isBase64('afQ$%rfew')); // false\nconsole.log(isBase64('dfasdfr342')); // false\nconsole.log(isBase64('uuLMhh==')); // true\nconsole.log(isBase64('uuLMhh')); // false\nconsole.log(isBase64('uuLMhh', {paddingRequired: false})); // true\nconsole.log(isBase64('')); // true\nconsole.log(isBase64('', {allowEmpty: false})); // false\n```\n\n## API\n\n## isBase64(string, options)\n\n- {string} string - string to check if is valid base64 string\n\n- {object} [options]\n    - [options.allowEmpty=true] {boolean} - returns true for empty string\n    - [options.allowMime=false] {boolean} - returns true for valid strings with optional mime\n    - [options.mimeRequired=false] {boolean} - returns true for valid strings with mime\n    - [options.paddingRequired=true] {boolean} - returns true for valid strings with valid padding\n\n## CLI\n\nInstall CLI:\n\n```bash\nnpm install -g is-base64\n```\n\nCLI example:\n\n```bash\n$ is-base64 aGVsbG8gd29ybGQ=\ntrue\n```\n\nPiping example:\n\n```bash\n$ echo aGVsbG8gd29ybGQ= | is-base64\ntrue\n```\n\n## FAQ\n\n- Q: Why is empty string `\"\"` a valid base64 string by default?\n\n  - A: According to [RFC 4648 Section 10](https://tools.ietf.org/html/rfc4648#section-10), the following is valid test vector:\n\n      ```\n      BASE64(\"\") = \"\"\n      ```\n\n# License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/miguelmota/is-base64","bugs":{"url":"https://github.com/miguelmota/is-base64/issues"},"license":"MIT"}