1.2.1 • Published 2 years ago

stream-to-string v1.2.1

Weekly downloads
97,134
License
MIT
Repository
github
Last release
2 years 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-2834wolkenkitwd-runjsxapi-activitiesxapi-agentsxapi-statexapi-statementsx-rayx-ray-2x-ray-2022x-ray-fork-pagination-fixx-ray-stream-fixx-ray-wrapper@cspotcode/gitlogg@comunica/actor-rdf-source-identifier-hypermedia-qpf@comunica/actor-rdf-dereference-http-parse@dadi/cachejambonjetson-flashjsdoc-to-json-schemarunforktopicdeck@anthonyjdella/customized-resume-cli@aragon/node-aragon@axah/polyfill-library@blockforfun/plugin-git@caruuto/cache@cautionyourblast/polyfill-library@ddn/x-ray@dexagod/ldn-agent@dexagod/rdf-retrievalts-ray@hanakla/rowen@gotoeasy/browserify@learninglocker/persona-service@learninglocker/xapi-activities@learninglocker/xapi-agents@learninglocker/xapi-service@learninglocker/xapi-state@learninglocker/xapi-statements@leonardodino/x-ray@manishrawat4u/x-ray@micro-app/shared-utils@marionebl/polyfill-library@marko/build@masnagam/npm-diet@mingshz/local-api-mocker@modern-js/polyfill-lib@kapouer/polyfill-library@jambon/core@razee/razeedash-api@programmerraj/create-index-js@shieldsbetter/slurp-uri@seagull-js/seagull-cli@seagull/build-toolsmississippi2mocha-chai-rdfmobilifynpm-migrate-allodrl-atomizeropen-github-eventsobject-detectionnunjucks-scaffolderpatternplate-serversample-seo-checkerscaphold-syncrss-combiner-nsrdf-dataset-fragmenterrdf-dereferencerdf-parserdf-test-suiterdf-serializerdfooproxy-objectreadable-shapromise-shaseo-defect-checkernode-images-scrapernjtoolpersonasplease-send-emailspre-push-validpoodle-servicepolymorphic-testspolyfill-librarypolyfill-library-none-intlpolyfill-serviceresinos-jetson-flashprodperfectprodperfectqa-runnerreal-php-cs-fixerpub-src-dropboxresume-cliresume-cli-devresumed-cliresults-parsershellshot
1.2.1

2 years ago

1.2.0

6 years ago

1.1.0

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago