All Projects → Borewit → readable-web-to-node-stream

Borewit / readable-web-to-node-stream

Licence: other
Converts a Web-API readable-stream into a Node readable-stream.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to readable-web-to-node-stream

xbytes
Parse bytes to human readable sizes (4747) → ('4.75 KB') and vice versa.
Stars: ✭ 17 (-48.48%)
Mutual labels:  converter, readable
oh-my-design-patterns
🎨 Record the articles and code I wrote while learning design patterns
Stars: ✭ 33 (+0%)
Mutual labels:  adapter
Multiselectadapter
MultiSelectAdapter可以让你的Adapter快速实现多选和批量操作
Stars: ✭ 195 (+490.91%)
Mutual labels:  adapter
mdconv
A tool to convert markdown to html.
Stars: ✭ 38 (+15.15%)
Mutual labels:  converter
Ecto mnesia
Ecto adapter for Mnesia Erlang term database.
Stars: ✭ 223 (+575.76%)
Mutual labels:  adapter
objectify-css
CLI for converting CSS rules to JavaScript style objects
Stars: ✭ 46 (+39.39%)
Mutual labels:  converter
Easyadapter
This project demonstrates simple approach for implementation complex lists, based on RecyclerView.
Stars: ✭ 187 (+466.67%)
Mutual labels:  adapter
fp-units
An FP-oriented library to easily convert CSS units.
Stars: ✭ 18 (-45.45%)
Mutual labels:  converter
java-xml-to-json
👾 convert XML to a structure-preserving JSON representation
Stars: ✭ 15 (-54.55%)
Mutual labels:  converter
InstantRecyclerView
A library that helps to implement a complex list with RecyclerView.(RecyclerView使用的封装与优化,帮助你快速利用RecyclerView构建复杂列表)
Stars: ✭ 22 (-33.33%)
Mutual labels:  adapter
cpc
Text calculator with support for units and conversion
Stars: ✭ 89 (+169.7%)
Mutual labels:  converter
Dsladapter
🔥 Kotlin时代的Adapter, Dsl 的形式使用 RecyclerView.Adapter, 支持折叠展开, 树结构,悬停,情感图状态切换, 加载更多, 多类型Item,侧滑菜单等
Stars: ✭ 231 (+600%)
Mutual labels:  adapter
guepard
flash to html5 converter, as3 to javascript translator
Stars: ✭ 58 (+75.76%)
Mutual labels:  converter
Commonadapter
一个适用于ListView/GridView/RecyclerView的Adapter库,简化大量重复代码,支持多种布局,可自定义图片加载的实现。
Stars: ✭ 219 (+563.64%)
Mutual labels:  adapter
Audiblex
Audible audio book converter which actually works!
Stars: ✭ 26 (-21.21%)
Mutual labels:  converter
Mongodb Adapter
MongoDB adapter for Casbin
Stars: ✭ 194 (+487.88%)
Mutual labels:  adapter
BatchEncoder
BatchEncoder is an audio files conversion software.
Stars: ✭ 145 (+339.39%)
Mutual labels:  converter
BaseToolsLibrary
Android通用适配器和常用的工具类
Stars: ✭ 24 (-27.27%)
Mutual labels:  adapter
json2table
Converts JSON to an HTML table
Stars: ✭ 52 (+57.58%)
Mutual labels:  converter
slackdown
A simple Slack message text formatting to HTML code converter.
Stars: ✭ 27 (-18.18%)
Mutual labels:  converter

CI browser tests NPM version npm downloads Known Vulnerabilities Codacy Badge Coverage Status Minified size

readable-web-to-node-stream

Converts a Web-API readable stream into a Node.js readable stream.

Installation

Install via npm:

npm install readable-web-to-node-stream

or yarn:

yarn add readable-web-to-node-stream

Compatibility

Source is written in TypeScript and compiled to ECMAScript 2017 (ES8).

Unit tests are performed on the following browsers:

  • Latest Google Chrome 74.0

Example

Import readable-web-stream-to-node in JavaScript:

const {ReadableWebToNodeStream} = require('readable-web-to-node-stream');

async function download(url) {
    const response = await fetch(url);
    const readableWebStream = response.body;
    const nodeStream = new ReadableWebToNodeStream(readableWebStream);
}

API

constructor(stream: ReadableStream): Promise

stream: ReadableStream: the Web-API readable stream.

close(): Promise Will cancel close the Readable-node stream, and will release Web-API-readable-stream.

waitForReadToComplete(): Promise If there is no unresolved read call to Web-API Readable​Stream immediately returns, otherwise it will wait until the read is resolved.

Licence

(The MIT License)

Copyright (c) 2019 Borewit

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].