Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit a651279

Browse files
author
Alan Shaw
committed
feat: metadata for ipfs.get
Pack file `mtime` and `mode` if set Depends on: * [ ] #2758 * [ ] ipfs-inactive/js-ipfs-http-client#1235
1 parent d8be8bb commit a651279

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"ipfs-bitswap": "^0.27.0",
9999
"ipfs-block": "~0.8.1",
100100
"ipfs-block-service": "~0.16.0",
101-
"ipfs-http-client": "^42.0.0",
101+
"ipfs-http-client": "github:ipfs/js-ipfs-http-client#feat/meta-for-get",
102102
"ipfs-http-response": "^0.5.0",
103103
"ipfs-mfs": "^1.0.0",
104104
"ipfs-multipart": "^0.3.0",

src/http/api/resources/files-regular.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ exports.get = {
9595
async function * (source) {
9696
for await (const file of source) {
9797
const header = {
98-
name: file.path
98+
name: file.path,
99+
mtime: file.mtime ? new Date(file.mtime.secs * 1000) : null,
100+
mode: file.mode
99101
}
100102

101103
if (file.content) {

0 commit comments

Comments
 (0)