1.0.4 • Published 8 years ago
read-source-stream v1.0.4
read-source-stream
Streaming read of local file or remote url.
Install
npm i read-source-stream --save
Usage
For more use-cases see the tests
<fp>
{String} filepath or remote url[opts]
{Object} options passed tofs.createReadStream
andsimple-get
returns
{Stream} Readable stream
Example
var read = require('read-source-stream')
// current working directory `package.json` file
read('package.json').pipe(process.stdout)
// package.json of `got` module
read('package.json', {cwd: 'node_modules/got'}).pipe(process.stdout)
// also works with CDN-like urls
read('//todomvc.com').pipe(process.stdout)
// http and https urls
read('https://github.com').pipe(process.stdout)
read('www.tunnckocore.tk').pipe(process.stdout)
Related
- encode-image-stream: Encode image to base64 string, just encode. ~20 sloc.
- gulp-micromatch: Filter vinyl files with glob patterns, string, regexp, array, object… more
- is-real-object: Returns
true
if a value is any type of object, but not an array. - path-exists: Check if a path exists
- simple-get: Simplest way to make http get requests. Supports HTTPS, redirects,… more
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.