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

Commit

Permalink
feat: metadata for ipfs.get
Browse files Browse the repository at this point in the history
Pack file `mtime` and `mode` if set

Depends on:

* [ ] #2758
* [ ] ipfs-inactive/js-ipfs-http-client#1235
  • Loading branch information
Alan Shaw committed Feb 9, 2020
1 parent d8be8bb commit a651279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"ipfs-bitswap": "^0.27.0",
"ipfs-block": "~0.8.1",
"ipfs-block-service": "~0.16.0",
"ipfs-http-client": "^42.0.0",
"ipfs-http-client": "github:ipfs/js-ipfs-http-client#feat/meta-for-get",
"ipfs-http-response": "^0.5.0",
"ipfs-mfs": "^1.0.0",
"ipfs-multipart": "^0.3.0",
Expand Down
4 changes: 3 additions & 1 deletion src/http/api/resources/files-regular.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ exports.get = {
async function * (source) {
for await (const file of source) {
const header = {
name: file.path
name: file.path,
mtime: file.mtime ? new Date(file.mtime.secs * 1000) : null,
mode: file.mode
}

if (file.content) {
Expand Down

0 comments on commit a651279

Please sign in to comment.