You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
* @param {String} [opts.hashAlg=sha2-256] - Algorithm to use when creating CIDs for newly created directories. (default: sha2-256) {@link https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343 The list of all possible values}
68
74
* @param {boolean} [opts.flush=true] - Whether or not to immediately flush MFS changes to disk (default: true).
* @param {String} path - The path to the directory to make.
90
+
* @param {Object} [opts] - Options for mkdir.
91
+
* @param {boolean} [opts.parents=false] - Value to decide whether or not to make the parent directories if they don't exist. (default: false)
92
+
* @param {String} [opts.format=dag-pb] - Format of nodes to write any newly created directories as. (default: dag-pb).
93
+
* @param {String} [opts.hashAlg] - Algorithm to use when creating CIDs for newly created directories. (default: sha2-256) {@link https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343 The list of all possible values}
94
+
* @param {boolean} [opts.flush=true] - Whether or not to immediately flush MFS changes to disk (default: true).
* @prop {number} cumulativeSize - Integer with the size of the DAGNodes making up the file in Bytes.
111
+
* @prop {string} type - Output type either 'directory' or 'file'.
112
+
* @prop {number} blocks - If type is directory, this is the number of files in the directory. If it is file it is the number of blocks that make up the file.
113
+
* @prop {boolean} withLocality - Indicate if locality information is present.
114
+
* @prop {boolean} local - Indicate if the queried dag is fully present locally.
115
+
* @prop {number} sizeLocal - Integer indicating the cumulative size of the data present locally.
116
+
*/
117
+
118
+
/**
119
+
* Get file or directory status.
120
+
*
121
+
* @param {String} path - Path to the file or directory to stat.
122
+
* @param {Object} [opts] - Options for stat.
123
+
* @param {boolean} [opts.hash=false] - Return only the hash. (default: false)
124
+
* @param {boolean} [opts.size=false] - Return only the size. (default: false)
125
+
* @param {boolean} [opts.withLocal=false] - Compute the amount of the dag that is local, and if possible the total size. (default: false)
126
+
* @param {String} [opts.cidBase=base58btc] - Which number base to use to format hashes - e.g. base32, base64 etc. (default: base58btc)
* @param {number} [opts.offset=0] - Integer with the byte offset to begin writing at. (default: 0)
216
+
* @param {boolean} [opts.create=false] - Indicate to create the file if it doesn't exist. (default: false)
217
+
* @param {boolean} [opts.truncate=false] - Indicate if the file should be truncated after writing all the bytes from content. (default: false)
218
+
* @param {boolena} [opts.parents=false] - Value to decide whether or not to make the parent directories if they don't exist. (default: false)
219
+
* @param {number} [opts.length] - Maximum number of bytes to read. (default: Read all bytes from content)
220
+
* @param {boolean} [opts.rawLeaves=false] - If true, DAG leaves will contain raw file data and not be wrapped in a protobuf. (default: false)
221
+
* @param {number} [opts.cidVersion=0] - The CID version to use when storing the data (storage keys are based on the CID, including its version). (default: 0)
* @param {string | Array<string>} from - Path(s) of the source to move.
244
+
* @param {string} to - Path of the destination to move to.
245
+
* @param {Object} opts - Options for mv.
246
+
* @param {boolean} [opts.parents=false] - Value to decide whether or not to make the parent directories if they don't exist. (default: false)
247
+
* @param {String} [opts.format=dag-pb] - Format of nodes to write any newly created directories as. (default: dag-pb).
248
+
* @param {String} [opts.hashAlg] - Algorithm to use when creating CIDs for newly created directories. (default: sha2-256) {@link https://github.com/multiformats/js-multihash/blob/master/src/constants.js#L5-L343 The list of all possible values}
249
+
* @param {boolean} [opts.flush=true] - Value to decide whether or not to immediately flush MFS changes to disk. (default: true)
* @returns {Promise<undefined> | void} When callback is provided nothing is returned.
252
+
* @description
253
+
* If from has multiple values then to must be a directory.
254
+
*
255
+
* If from has a single value and to exists and is a directory, from will be moved into to.
256
+
*
257
+
* If from has a single value and to exists and is a file, from must be a file and the contents of to will be replaced with the contents of from otherwise an error will be returned.
258
+
*
259
+
* If from is an IPFS path, and an MFS path exists with the same name, the IPFS path will be chosen.
260
+
*
261
+
* All values of from will be removed after the operation is complete unless they are an IPFS path.
0 commit comments