From dd9cf7327721aea139f2ef8cbf29169a6c34b3d2 Mon Sep 17 00:00:00 2001 From: Matt Ober Date: Thu, 14 May 2020 14:22:04 -0500 Subject: [PATCH] Updated globSource example with options This updates the example for adding files with ipfs.add and globSource to reflect the syntax that should be utilized when passing in additional add options. --- docs/core-api/FILES.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/core-api/FILES.md b/docs/core-api/FILES.md index 50cfe87718..609516e95d 100644 --- a/docs/core-api/FILES.md +++ b/docs/core-api/FILES.md @@ -247,7 +247,19 @@ const { globSource } = IPFS const ipfs = await IPFS.create() -for await (const file of ipfs.add(globSource('./docs', { recursive: true }))) { +//options specific to globSource +const globSourceOptions = { + recursive: true +}; + +//example options to pass to IPFS +const addOptions = { + pin: true, + wrapWithDirectory: true, + timeout: 10000 +}; + +for await (const file of ipfs.add(globSource('./docs', globSourceOptions), addOptions)) { console.log(file) }