This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +34
-13
lines changed Expand file tree Collapse file tree 1 file changed +34
-13
lines changed Original file line number Diff line number Diff line change @@ -222,33 +222,54 @@ curl 'http://localhost:5001/api/v0/object/get?arg=QmYEqnfCZp7a39Gxrgyv3qRS4MoCTG
222
222
223
223
##### mkdir
224
224
225
- bash:
226
- ` curl "http://localhost:5001/api/v0/files/mkdir?arg=%2F<folder name> ` "
227
-
228
- response: (it returns empty when successful)
229
- ```
230
- ```
231
-
232
- javascript:
233
225
``` JavaScript
234
226
ipfs .files .mkdir (< folderName> , function (err ) {})
235
227
```
236
228
237
- response: (it returns empty when successful)
238
- ```
239
- ```
240
-
241
229
##### cp
242
230
231
+ ``` JavaScript
232
+ ipfs .files .cp ([< pathSrc> , < pathDst> ], function (err ) {})
233
+ ```
234
+
243
235
##### ls
244
236
237
+ ``` JavaScript
238
+ ipfs .files .ls (< path> , function (err , res ) {})
239
+ ```
240
+
245
241
##### stat
246
242
243
+ ``` JavaScript
244
+ ipfs .files .stat (< path> , function (err , res ) {})
245
+ ```
246
+
247
247
##### rm
248
248
249
+ ``` JavaScript
250
+ ipfs .files .rm (< path> , [< options> ], function (err ) {})
251
+ ```
252
+
253
+ For ` rm -r ` pass a options obj with ` r: true `
254
+
249
255
##### read
250
256
257
+ ``` JavaScript
258
+ ipfs .files .read (< path> , function (err , res ) {
259
+ if (res .readable ) {
260
+ // Returned as a stream
261
+ res .pipe (process .stdout )
262
+ } else {
263
+ // Returned as a string
264
+ console .log (res)
265
+ }
266
+ })
267
+ ```
268
+
251
269
##### write
252
270
253
271
##### mv
254
- curl "http://localhost:5001/api/v0/files/mkdir?arg=%2Ffolder4 "
272
+
273
+ ``` JavaScript
274
+ ipfs .files .mv ([< pathSrc> , < pathDst> ], function (err ) {})
275
+ ```
You can’t perform that action at this time.
0 commit comments