{"_id":"strong-data-uri","_rev":"214432","name":"strong-data-uri","description":"Parser and builder for `data:` URIs","dist-tags":{"latest":"1.0.6"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"time":{"modified":"2021-06-03T15:33:51.000Z","created":"2013-09-12T09:44:15.083Z","1.0.6":"2018-05-31T09:03:33.833Z","1.0.5":"2018-02-26T12:46:23.300Z","1.0.4":"2016-05-04T00:04:29.368Z","1.0.3":"2015-09-21T16:27:16.149Z","1.0.2":"2015-09-09T15:44:23.279Z","1.0.1":"2015-06-09T05:35:33.897Z","1.0.0":"2015-05-06T13:30:26.823Z","0.2.0":"2015-04-22T06:23:40.996Z","0.1.1":"2014-01-21T09:48:16.413Z","0.1.0":"2013-09-12T09:44:15.083Z"},"users":{},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"versions":{"1.0.6":{"name":"strong-data-uri","version":"1.0.6","description":"Parser and builder for `data:` URIs","license":"Artistic-2.0","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"^2.0.1"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"841e3850572f0ddafc2f6f98877fb8271039e088","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.6","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"bajtos","email":"mbajtoss@gmail.com"},"dist":{"shasum":"048d501faabaf4c268c608e4b167b06f03ba62b7","size":9156,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.6.tgz"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strong-data-uri_1.0.6_1527757413775_0.2822871041906809"},"_hasShrinkwrap":false,"publish_time":1527757413833,"_cnpm_publish_time":1527757413833},"1.0.5":{"name":"strong-data-uri","version":"1.0.5","description":"Parser and builder for `data:` URIs","license":"Artistic-2.0","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"^2.0.1"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"16db2d0b84d292289d8c8e5eb70cf6ee107444d1","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.5","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bajtos","email":"mbajtoss@gmail.com"},"dist":{"shasum":"b2c142b04eab7dc6876a5caa27883402f3675ea6","size":9113,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.5.tgz"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strong-data-uri_1.0.5_1519649183253_0.0341294497113227"},"_hasShrinkwrap":false,"publish_time":1519649183300,"_cnpm_publish_time":1519649183300},"1.0.4":{"name":"strong-data-uri","version":"1.0.4","description":"Parser and builder for `data:` URIs","license":"Artistic-2.0","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"afe6eff520c576c66c3d85997cbc0a862fc84e32","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.4","_shasum":"136765ebaf8e0f4ad60c4b146779f062c29d18f0","_from":".","_npmVersion":"3.8.8","_nodeVersion":"4.4.3","_npmUser":{"name":"rmg","email":"r.m.graham@gmail.com"},"dist":{"shasum":"136765ebaf8e0f4ad60c4b146779f062c29d18f0","size":9224,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.4.tgz"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/strong-data-uri-1.0.4.tgz_1462320267028_0.43716702749952674"},"directories":{},"publish_time":1462320269368,"_cnpm_publish_time":1462320269368,"_hasShrinkwrap":false},"1.0.3":{"name":"strong-data-uri","version":"1.0.3","description":"Parser and builder for `data:` URIs","license":"Artistic-2.0","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"146d32f9206ea217c3b6ff5f642876adec3d4dd3","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.3","_shasum":"0edbd175e7900ae28c939dea9d4d31c03afbd6b6","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"0edbd175e7900ae28c939dea9d4d31c03afbd6b6","size":12186,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.3.tgz"},"directories":{},"publish_time":1442852836149,"_cnpm_publish_time":1442852836149,"_hasShrinkwrap":false},"1.0.2":{"name":"strong-data-uri","version":"1.0.2","description":"Parser and builder for `data:` URIs","license":"SEE LICENSE IN LICENSE","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"635144767ab9171b2106a892a7e502e6e1c94e0e","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.2","_shasum":"9d16bb183c5b7a164db69e348cf03c3660ab530f","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"9d16bb183c5b7a164db69e348cf03c3660ab530f","size":12141,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.2.tgz"},"directories":{},"publish_time":1441813463279,"_cnpm_publish_time":1441813463279,"_hasShrinkwrap":false},"1.0.1":{"name":"strong-data-uri","version":"1.0.1","description":"Parser and builder for `data:` URIs","license":"(MIT OR LicenseRef-LICENSE.md)","main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"cac7b891169e7943f960eee0d39d13aba4312cd8","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.1","_shasum":"6482d0ab096ff6da5c9c5894128a5aa0616e0740","_from":".","_npmVersion":"2.11.0","_nodeVersion":"2.2.1","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"6482d0ab096ff6da5c9c5894128a5aa0616e0740","size":12104,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.1.tgz"},"directories":{},"publish_time":1433828133897,"_cnpm_publish_time":1433828133897,"_hasShrinkwrap":false},"1.0.0":{"name":"strong-data-uri","version":"1.0.0","description":"Parser for `data:` URIs","license":{"name":"Dual MIT/StrongLoop","url":"https://github.com/strongloop/strong-data-uri/blob/master/LICENSE"},"main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"git+https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"8d62293484a7a1bf35964cde301f24960a39f9e3","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri#readme","_id":"strong-data-uri@1.0.0","_shasum":"7a3ff9fb313049ffc6951c506a46911a54c4678b","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.0.0","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"7a3ff9fb313049ffc6951c506a46911a54c4678b","size":12073,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-1.0.0.tgz"},"directories":{},"publish_time":1430919026823,"_cnpm_publish_time":1430919026823,"_hasShrinkwrap":false},"0.2.0":{"name":"strong-data-uri","version":"0.2.0","description":"Parser for `data:` URIs","license":{"name":"Dual MIT/StrongLoop","url":"https://github.com/strongloop/strong-data-uri/blob/master/LICENSE"},"main":"index.js","scripts":{"pretest":"jshint *.js test","test":"istanbul test -- _mocha -R spec","posttest":"test -z $npm_config_coverage || istanbul report"},"repository":{"type":"git","url":"https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"~1.17.1","jshint":"~2.4.3","istanbul":"~0.2.4","chai":"~1.8.1"},"engines":{"node":">=0.8.0"},"gitHead":"adfdd3ba9de5187a58c1d69ad07c5e9bc1d3f6dc","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri","_id":"strong-data-uri@0.2.0","_shasum":"e70a6efbdbdec2b8f174bb085862037a124d6ccf","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"e70a6efbdbdec2b8f174bb085862037a124d6ccf","size":11018,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-0.2.0.tgz"},"directories":{},"publish_time":1429683820996,"_cnpm_publish_time":1429683820996,"_hasShrinkwrap":false},"0.1.1":{"name":"strong-data-uri","version":"0.1.1","description":"Parser for `data:` URIs","license":"MIT","main":"index.js","scripts":{"pretest":"./node_modules/.bin/jshint *.js test","test":"./node_modules/.bin/mocha --reporter spec","posttest":"./node_modules/.bin/mocha --require blanket -R html-cov > coverage.html"},"repository":{"type":"git","url":"https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"latest","jshint":"latest","blanket":"latest","chai":"latest"},"engines":{"node":">=0.8.0"},"config":{"blanket":{"pattern":"//^((?!(node_modules|test)).)*$/"}},"bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"homepage":"https://github.com/strongloop/strong-data-uri","_id":"strong-data-uri@0.1.1","dist":{"shasum":"8660241807461d1d2dd247c70563f2f33e66c8ab","size":7750,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"directories":{},"publish_time":1390297696413,"_cnpm_publish_time":1390297696413,"_hasShrinkwrap":false},"0.1.0":{"name":"strong-data-uri","version":"0.1.0","description":"Parser for `data:` URIs","license":"MIT","main":"index.js","scripts":{"coverage":"./node_modules/.bin/mocha -r blanket -R html-cov > coverage.html","test":"mocha --reporter spec","lint":"./node_modules/.bin/jshint *.js test"},"repository":{"type":"git","url":"https://github.com/strongloop/strong-data-uri.git"},"author":{"name":"Miroslav Bajtos","email":"miroslav@strongloop.com"},"dependencies":{"truncate":"~1.0.2"},"devDependencies":{"mocha":"latest","jshint":"latest","blanket":"latest","chai":"latest"},"engines":{"node":">=0.8.0"},"readmeFilename":"README.md","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"_id":"strong-data-uri@0.1.0","dist":{"shasum":"a41235806b8c3bf0f6f324dc57dfe85bbab681a0","size":7829,"noattachment":false,"key":"/strong-data-uri/-/strong-data-uri-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/strong-data-uri/download/strong-data-uri-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"bajtos","email":"miro.bajtos@gmail.com"},"maintainers":[{"name":"0candy","email":"ngcandy@ca.ibm.com"},{"name":"hacksparrow","email":"captain@hacksparrow.com"},{"name":"ritch","email":"skawful@gmail.com"}],"directories":{},"publish_time":1378979055083,"_cnpm_publish_time":1378979055083,"_hasShrinkwrap":false}},"readme":"# strong-data-uri\n\n[![Build Status](https://travis-ci.org/strongloop/strong-data-uri.png?branch=master)](https://travis-ci.org/strongloop/strong-data-uri)\n[![NPM version](https://badge.fury.io/js/strong-data-uri.png)](http://badge.fury.io/js/strong-data-uri)\n\n## Overview\nstrong-data-uri implements a parser for retrieving data encoded\nin `data:` URIs specified by [RFC2397](http://www.ietf.org/rfc/rfc2397.txt),\nas well as an encoder for those URIs.\n\n## API\n\n - [decode](#decodeuri)\n - [encode](#encodedata-mediatype)\n\n### decode(uri)\n\nCall `dataUri.decode(uri)` to parse the payload of a data URI. The `uri`\nargument expects a string.\n\n```js\nvar dataUri = require('strong-data-uri');\nvar uri = 'data:text/plain;charset=iso-8859-1;base64,aGVsbG8gd29ybGQ=';\n\nvar buffer = dataUri.decode(uri);\nconsole.log(buffer);\n// <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>\nconsole.log(buffer.toString('ascii'));\n// Hello world\n\nconsole.log(buffer.mimetype);  // text/plain\nconsole.log(buffer.mediatype); // text/plain;charset=iso-8859-1\nconsole.log(buffer.charset);   // iso-8859-1\n```\n\n### encode(data, [mediatype])\n\nUse `dataUri.encode(data, mediatype)` to build a new data URI. The `data`\nargument can be a `Buffer` or a `String`. Strings are converted to buffers\nusing `utf-8` encoding.\n\nIf `mediatype` is not specified, then `application/octet-stream` is used\nas a default if the data is a Buffer, and `text/plain;charset=UTF-8` if\nthe data is a String.\n\n```js\nvar dataUri = require('strong-data-uri');\n\nuri = dataUri.encode('foo');\nconsole.log(uri);\n// data:text/plain;charset=UTF-8;base64,Zm9v\n\nuri = dataUri.encode(new Buffer('<foo/>', 'utf8'), 'text/xml');\nconsole.log(uri);\n// data:text/xml;base64,PGZvby8+\n```\n\n## Command-line access\n\nTo keep this project small and light, no command-line tool is provided.  If you\nneed one, please consider [data-colon](https://github.com/hildjj/data-colon).\n","_attachments":{},"homepage":"https://github.com/strongloop/strong-data-uri#readme","bugs":{"url":"https://github.com/strongloop/strong-data-uri/issues"},"license":"Artistic-2.0"}