Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
stream-from-to
Advanced tools
Utility for piping to/from a stream from a variety of sources to a variety of destinations
Utility for piping to/from a stream from a variety of sources to a variety of destinations.
Pass stream-from-to a function that creates a through stream and it'll give you back an object that simplifies the constructon of source and destination streams for piping to/from the through stream.
var streamft = require("stream-from-to")
, through = require("through")
var mdToHtml = function (filePath) {
// Through stream that converts markdown to HTML
return through()
}
streamft(mdToHtml).from.path("/path/to/doc.md").to.path("/path/to/doc.html", function (er) {
if (er) return console.error(er)
// Done!
})
With brfs:
var streamft = require("stream-from-to")
, brfs = require("brfs")
streamft(brfs).from("src/index.js").to("dist/index.js")
Create a readable stream from path
and pipe to the through stream. path
can be a single path or array of paths.
Create a readable stream from string
and pipe to the through stream. string
can be a single string or array of strings.
Create and concatinate readable streams from paths
and pipe to the through stream.
Create and concatinate readable streams from strings
and pipe to the through stream.
Create a writeable stream to path
and pipe output from the through stream to it. path
can be a single path, or array of output paths if you specified an array of inputs. The callback function cb
will be invoked when data has finished being written.
Create a concat-stream and pipe output from the through stream to it. The callback function cb
will be invoked when the buffer has been created.
Create a concat-stream and pipe output from the through stream to it. The callback function cb
will be invoked when the string has been created.
FAQs
Utility for piping to/from a stream from a variety of sources to a variety of destinations
We found that stream-from-to demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.