-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Issue with example for ipfs add #3740
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Appears to be a typo in your example:
should be:
Edit: Oh I see, that's straight from the docs. Good eye. |
This worked for me:
|
@sreeharshar84 or @TheDiscordian : thanks for catching. Can you make a PR for the doc update please? |
The example in ipfs.add (https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#ipfsadddata-options) lists the following example.
This is clearly wrong, there is no variable with the name "content"
const file = {
path: '/tmp/myfile.txt',
content: 'ABC'
}
const result = await ipfs.add(content)
console.info(result)
/*
Prints:
{
"path": "tmp",
"cid": CID("QmWXdjNC362aPDtwHPUE9o2VMqPeNeCQuTBTv1NsKtwypg"),
"mode": 493,
"mtime": { secs: Number, nsecs: Number },
"size": 67
}
*/
Severity:
Description:
Steps to reproduce the error:
The text was updated successfully, but these errors were encountered: