1.2.1 • Published 1 year ago

stream-to-string v1.2.1

Weekly downloads
97,134
License
MIT
Repository
github
Last release
1 year ago

stream-to-string

NPM version Build Status Coverage Status

Pipe a stream into a string, collect value with callback or promise

example

var toString = require('..'),
    through2 = require('through2'),
    stream   = through2()

toString(stream, function (err, msg) {
    console.log(msg)
})

# or with promises
toString(stream).then(function (msg) {
    console.log(msg)
})

stream.write('this is a')
stream.write(' test')
stream.end()

api

var toString = require('stream-to-string')

toString(stream, enc)

Collects stream data into a string. Accepts an optional encoding argument used when converting the stream. Executes optional callback with err, string. Returns a promise.

testing

npm test [--dot | --spec] [--coverage | --grep=pattern]

Specifying --dot or --spec will change the output from the default TAP style. Specifying --coverage will print a text coverage summary to the terminal after tests have ran, while --pattern will only run the test files that match the given pattern.

Open an html coverage report with npm run view-cover.

rdflib-tsexpress-jsdoc@infinitebrahmanuniverse/nolb-stream-@everything-registry/sub-chunk-2834wd-runjswolkenkit@gotoeasy/browserify@hanakla/rowen@manishrawat4u/x-ray@marko/build@marionebl/polyfill-library@masnagam/npm-diettopicdeckts-rayx-rayx-ray-2x-ray-2022x-ray-fork-pagination-fixx-ray-stream-fixx-ray-wrapperxapi-activitiesxapi-agentsxapi-statexapi-statements@kapouer/polyfill-libraryexp-fetch-body-parser@leonardodino/x-ray@learninglocker/persona-service@learninglocker/xapi-activities@learninglocker/xapi-agents@learninglocker/xapi-service@learninglocker/xapi-state@learninglocker/xapi-statementsfetch-sparql-endpointelectron-hazel-update-servergraphql-ld-sparqlendpointfrictionless-js-browserfrictionless.jsfusebox-gulp-plugin@micro-app/shared-utilsfoso-cdn@mingshz/local-api-mocker@mrhenry/polyfill-library@modern-js/polyfill-libgit-git-syncgithub-cornerifyelectraesmiley-jsdoc-to-json-schemahyperfeed@jambon/core@programmerraj/create-index-jshttp-rdf-formats-proxyhtml-inject-github-cornergulpplugintesthelpersgulp-yumlhazel-server@razee/razeedash-api@seagull-js/seagull-cli@seagull/build-toolsjetson-flash@shieldsbetter/slurp-urijambon@steedos/meteor-bundle-dependencies@steedos/ee_stimulsoft-reports@steedos-labs/stimulsoft-reports@the-ksquare-group/resume-cli@thegu5/x-ray@thedadi/polyfill-library@tradle/x-raykoreografeyemobilify@anthonyjdella/customized-resume-cliblastoise-shell@blockforfun/plugin-git@axah/polyfill-libraryarfeaxios-pushjsdoc-to-json-schema@comunica/actor-rdf-dereference-http-parsenpm-migrate-all@comunica/actor-rdf-parse-shaclc@comunica/actor-rdf-parse-jsonld@comunica/actor-rdf-source-identifier-hypermedia-qpf@comunica/actor-rdf-update-hypermedia-sparql@comunica/bus-rdf-update-quads@dadi/cacheatop-cli@aragon/node-aragonmagic-erasenode-images-scrapernjtoolcdnfly@comunica/actor-dereference-http@comunica/actor-http-wayback@cspotcode/gitlogg@types/stream-to-stringmaelstromjsmapperidea-cli@xopyip/hazel-servermississippi2
1.2.1

1 year ago

1.2.0

5 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago