Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit f02a941

Browse files
authored
feat: convert to async/await (#49)
* feat: convert to async/await BREAKING CHANGES: 1. Everything is now async/await 2. No more callbacks, Readable Streams or Pull Streams 3. `stat` and `ls` commands return `cid` objects instead of string hashes 4. `stat` and `ls` commands return all fields, `hash`, `long` etc options are now ignored * chore: standardise error codes, use latest cids and ipld formats * chore: update importer and exporter * chore: update importer again * chore: update deps
1 parent 25bf86b commit f02a941

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2027
-3094
lines changed

package.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"release": "aegir release",
1919
"release-minor": "aegir release --type minor",
2020
"release-major": "aegir release --type major",
21-
"coverage": "aegir coverage"
21+
"coverage": "aegir coverage",
22+
"dep-check": "aegir dep-check"
2223
},
2324
"repository": {
2425
"type": "git",
@@ -38,41 +39,38 @@
3839
"homepage": "https://github.com/ipfs/js-ipfs-mfs#readme",
3940
"devDependencies": {
4041
"aegir": "^18.0.2",
42+
"async-iterator-all": "^1.0.0",
4143
"chai": "^4.2.0",
4244
"detect-node": "^2.0.4",
4345
"detect-webworker": "^1.0.0",
4446
"dirty-chai": "^2.0.1",
45-
"ipld": "~0.21.1",
46-
"ipld-in-memory": "^2.0.0",
47-
"multihashes": "~0.4.14",
48-
"pull-buffer-stream": "^1.0.1",
49-
"pull-traverse": "^1.0.3",
47+
"ipfs-block-service": "~0.15.2",
48+
"ipfs-repo": "~0.26.4",
49+
"ipld": "~0.24.0",
50+
"memdown": "^4.0.0",
5051
"temp-write": "^3.4.0"
5152
},
5253
"dependencies": {
53-
"async": "^2.6.1",
54-
"cids": "~0.5.5",
54+
"async-iterator-last": "^1.0.0",
55+
"boom": "^7.2.0",
56+
"cids": "~0.7.1",
5557
"debug": "^4.1.0",
56-
"filereader-stream": "^2.0.0",
58+
"err-code": "^1.1.2",
5759
"hamt-sharding": "~0.0.2",
5860
"interface-datastore": "~0.6.0",
5961
"ipfs-multipart": "~0.1.0",
6062
"ipfs-unixfs": "~0.1.16",
61-
"ipfs-unixfs-exporter": "~0.36.1",
62-
"ipfs-unixfs-importer": "~0.38.5",
63-
"ipld-dag-pb": "~0.15.2",
64-
"is-pull-stream": "~0.0.0",
65-
"is-stream": "^1.1.0",
63+
"ipfs-unixfs-exporter": "~0.37.1",
64+
"ipfs-unixfs-importer": "~0.39.3",
65+
"ipld-dag-pb": "~0.17.1",
6666
"joi": "^14.3.0",
6767
"joi-browser": "^13.4.0",
6868
"mortice": "^1.2.1",
69+
"multicodec": "~0.5.1",
70+
"multihashes": "~0.4.14",
6971
"once": "^1.4.0",
7072
"promisify-es6": "^1.0.3",
71-
"pull-cat": "^1.1.11",
72-
"pull-defer": "~0.2.3",
73-
"pull-stream": "^3.6.9",
74-
"pull-stream-to-stream": "^1.3.4",
75-
"stream-to-pull-stream": "^1.7.2"
73+
"pull-stream": "^3.6.9"
7674
},
7775
"contributors": [
7876
"Alan Shaw <[email protected]>",

src/cli/flush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const {
44
FILE_SEPARATOR
5-
} = require('../core/utils')
5+
} = require('../core/utils/constants')
66

77
module.exports = {
88
command: 'flush [path]',

src/cli/ls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
} = require('./utils')
1010
const {
1111
FILE_SEPARATOR
12-
} = require('../core/utils')
12+
} = require('../core/utils/constants')
1313

1414
module.exports = {
1515
command: 'ls [path]',

src/cli/write.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ module.exports = {
109109
argv.resolve((async () => {
110110
const ipfs = await getIpfs()
111111

112-
return ipfs.files.write(path, process.stdin, {
112+
await ipfs.files.write(path, process.stdin, {
113113
offset,
114114
length,
115115
create,

0 commit comments

Comments
 (0)