Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 13f2c92

Browse files
committedNov 22, 2015
add readme documentation for files
1 parent b7595ad commit 13f2c92

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed
 

‎README.md

+39-11
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,11 @@ curl 'http://localhost:5001/api/v0/object/get?arg=QmYEqnfCZp7a39Gxrgyv3qRS4MoCTG
228228

229229
##### mkdir
230230

231-
bash:
232-
`curl "http://localhost:5001/api/v0/files/mkdir?arg=%2F<folder name>`"
233-
234-
response: (it returns empty when successful)
235-
```
236-
```
237-
238-
javascript:
239231
```JavaScript
240232
ipfs.files.mkdir(<folderName>, function (err) {})
241233
```
242234

235+
<<<<<<< b7595adb6e402164a28c2ec8193249182e62b592
243236
<<<<<<< 4308ddc1ef008e123922a46bad67f5ad758e66fb
244237
##### cp
245238

@@ -288,23 +281,58 @@ ipfs.files.read(<path>, function (err, res) {
288281
```JavaScript
289282
ipfs.files.mv([<pathSrc>, <pathDst>], function (err) {})
290283
```
291-
=======
284+
292285
response: (it returns empty when successful)
293-
```
294-
```
295286

296287
##### cp
297288

289+
```JavaScript
290+
ipfs.files.cp([<pathSrc>, <pathDst>], function (err) {})
291+
```
292+
298293
##### ls
299294

295+
```JavaScript
296+
ipfs.files.ls(<path>, function (err, res) {})
297+
```
298+
300299
##### stat
301300

301+
```JavaScript
302+
ipfs.files.stat(<path>, function (err, res) {})
303+
```
304+
302305
##### rm
303306

307+
```JavaScript
308+
ipfs.files.rm(<path>, [<options>], function (err) {})
309+
```
310+
311+
For `rm -r` pass a options obj with `r: true`
312+
304313
##### read
305314

315+
```JavaScript
316+
ipfs.files.read(<path>, function (err, res) {
317+
if(res.readable) {
318+
// Returned as a stream
319+
res.pipe(process.stdout)
320+
} else {
321+
// Returned as a string
322+
console.log(res)
323+
}
324+
})
325+
```
326+
306327
##### write
307328

308329
##### mv
330+
<<<<<<< b7595adb6e402164a28c2ec8193249182e62b592
309331
curl "http://localhost:5001/api/v0/files/mkdir?arg=%2Ffolder4"
310332
>>>>>>> files api tests
333+
=======
334+
335+
```JavaScript
336+
ipfs.files.mv([<pathSrc>, <pathDst>], function (err) {})
337+
```
338+
>>>>>>> add readme documentation for files

0 commit comments

Comments
 (0)
This repository has been archived.