-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert to async iterators (#15)
* Remove support for Node.js streams and pull streams * Adds a `urlSource` utility that will be exported by `js-ipfs-http-client` and `js-ipfs` along side `globSource` BREAKING CHANGE: Support for Node.js streams and Pull Streams has been removed
- Loading branch information
1 parent
71a7bf5
commit 251eff0
Showing
9 changed files
with
21 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,23 +29,18 @@ | |
"buffer": "^5.2.1", | ||
"err-code": "^2.0.0", | ||
"fs-extra": "^8.1.0", | ||
"is-buffer": "^2.0.3", | ||
"is-electron": "^2.2.0", | ||
"is-pull-stream": "0.0.0", | ||
"is-stream": "^2.0.0", | ||
"it-glob": "0.0.4", | ||
"kind-of": "^6.0.2", | ||
"pull-stream-to-async-iterator": "^1.0.2", | ||
"readable-stream": "^3.4.0" | ||
"it-glob": "0.0.6", | ||
"ky": "^0.15.0", | ||
"ky-universal": "^0.3.0", | ||
"stream-to-it": "^0.2.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^20.3.0", | ||
"async-iterator-all": "^1.0.0", | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"dirty-chai": "^2.0.1", | ||
"pull-stream": "^3.6.13", | ||
"readable-stream-2": "npm:readable-stream@^2.0.0" | ||
"dirty-chai": "^2.0.1" | ||
}, | ||
"contributors": [ | ||
"Alan Shaw <[email protected]>", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict' | ||
|
||
const { default: ky } = require('ky-universal') | ||
const toIterable = require('stream-to-it/source') | ||
|
||
module.exports = async function * urlSource (url, options) { | ||
options = options || {} | ||
|
||
const { body } = await ky.get(url) | ||
|
||
yield { | ||
path: decodeURIComponent(new URL(url).pathname.split('/').pop() || ''), | ||
content: toIterable(body) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.