Sha256: f19233f940d542276f2c82c19938ece78ddc5a8ae614a274a7d8eb523e951f3f
Contents?: true
Size: 1.92 KB
Versions: 21
Compression:
Stored size: 1.92 KB
Contents
{ "name": "stringstream", "version": "0.0.4", "description": "Encode and decode streams into string streams", "author": { "name": "Michael Hart", "email": "michael.hart.au@gmail.com", "url": "http://github.com/mhart" }, "main": "stringstream.js", "keywords": [ "string", "stream", "base64", "gzip" ], "repository": { "type": "git", "url": "https://github.com/mhart/StringStream.git" }, "license": "MIT", "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/mhart/StringStream/issues" }, "homepage": "https://github.com/mhart/StringStream", "_id": "stringstream@0.0.4", "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", "_from": "stringstream@~0.0.4", "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", "scripts": {} }
Version data entries
21 entries across 7 versions & 1 rubygems