https://github.com/m-ryan/tranform-to-readstream
tranform-to-readstream
https://github.com/m-ryan/tranform-to-readstream
readstream stream
Last synced: 2 months ago
JSON representation
tranform-to-readstream
- Host: GitHub
- URL: https://github.com/m-ryan/tranform-to-readstream
- Owner: m-Ryan
- Created: 2019-03-19T14:51:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-19T14:52:17.000Z (about 6 years ago)
- Last Synced: 2024-04-24T18:55:25.834Z (about 1 year ago)
- Topics: readstream, stream
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# tranform-to-readstream
---
Install
---```js
npm install --save tranform-to-readstream```
```js
yarn add tranform-to-readstream```
Usage
---
string
```js
import TranformToReadStream from 'tranform-to-readstream';const readStream = new TranformToReadStream('hello word', { encoding: 'utf8'});
```
or buffer
```js
import axios from 'axios';
import TranformToReadStream from 'tranform-to-readstream';const res = await axios({
url: `http://assets.maocanhua.cn/FrIHg7SNAUqOU1WAlLGz6uCmHBiD`,
responseType: 'arraybuffer'
})
const readStream = new TranformToReadStream(res.data);```