react / wstein / node_modules / jest-cli / node_modules / jsdom / node_modules / request / node_modules / stringstream / package.json
81144 views{1"name": "stringstream",2"version": "0.0.4",3"description": "Encode and decode streams into string streams",4"author": {5"name": "Michael Hart",6"email": "[email protected]",7"url": "http://github.com/mhart"8},9"main": "stringstream.js",10"keywords": [11"string",12"stream",13"base64",14"gzip"15],16"repository": {17"type": "git",18"url": "https://github.com/mhart/StringStream.git"19},20"license": "MIT",21"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",22"readmeFilename": "README.md",23"_id": "[email protected]",24"dist": {25"shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",26"tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"27},28"_npmVersion": "1.2.0",29"_npmUser": {30"name": "hichaelmart",31"email": "[email protected]"32},33"maintainers": [34{35"name": "hichaelmart",36"email": "[email protected]"37}38],39"directories": {},40"_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",41"_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz",42"_from": "stringstream@>=0.0.4 <0.1.0"43}444546