Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit bc92f91

Browse files
authored
Merge pull request #30 from ipfs/feature/standardize-readme
Standardize README
2 parents 54ff44c + b16d9e5 commit bc92f91

File tree

1 file changed

+91
-35
lines changed

1 file changed

+91
-35
lines changed

README.md

+91-35
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,76 @@
1-
interface-ipfs-core
2-
===================
1+
# interface-ipfs-core
32

43
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
54
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
6-
7-
> A test suite and interface you can use to implement the IPFS Core API.
5+
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
6+
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
7+
8+
> A test suite and interface you can use to implement a IPFS core interface.
9+
10+
## Table of Contents
11+
12+
- [Background](#background)
13+
- [Modules that implement the interface](#modules-that-implement-the-interface)
14+
- [Badge](#badge)
15+
- [Install](#install)
16+
- [Usage](#usage)
17+
- [Node.js](#nodejs)
18+
- [Go](#go)
19+
- [API](#api)
20+
- [Files](#files)
21+
- [`add`](#add)
22+
- [`createAddStream`](#createaddstream)
23+
- [`cat`](#cat)
24+
- [Object](#object)
25+
- [`object.new`](#objectnew)
26+
- [`object.put`](#objectput)
27+
- [`object.get`](#objectget)
28+
- [`object.data`](#objectdata)
29+
- [`object.links`](#objectlinks)
30+
- [`object.stat`](#objectstat)
31+
- [`object.patch`](#objectpatch)
32+
- [`object.patch.addLink`](#objectpatchaddlink)
33+
- [`object.patch.rmLink`](#objectpatchrmlink)
34+
- [`object.patch.appendData`](#objectpatchappenddata)
35+
- [`object.patch.setData`](#objectpatchsetdata)
36+
- [Contribute](#contribute)
37+
- [Want to hack on IPFS?](#want-to-hack-on-ipfs)
38+
- [License](#license)
39+
40+
## Background
841

942
The primary goal of this module is to define and ensure that both IPFS core implementations and their respective HTTP client libraries offer the same interface, so that developers can quickly change between a local and a remote node without having to change their applications. In addition to the definition of the expected interface, this module offers a suite of tests that can be run in order to check if the interface is used as described.
1043

1144
The API is presented with both Node.js and Go primitives. However, there are no actual limitations keeping it from being extended for any other language, pushing forward cross compatibility and interoperability through different stacks.
1245

13-
# Modules that implement the interface
46+
### Modules that implement the interface
1447

1548
- **WIP** [JavaScript IPFS implementation](https://github.com/ipfs/js-ipfs)
1649
- **WIP** [JavaScript ipfs-api](https://github.com/ipfs/js-ipfs-api)
1750
- Soon, go-ipfs, go-ipfs-api, java-ipfs-api, python-ipfs-api and others will implement it as well.
1851

1952
Send in a PR if you find or write one!
2053

21-
# Badge
54+
### Badge
2255

2356
Include this badge in your readme if you make a new module that implements
2457
interface-ipfs-core API.
2558

2659
![](/img/badge.png)
2760

28-
# How to use the battery of tests
61+
## Install
62+
63+
```js
64+
npm install interface-ipfs-core
65+
```
66+
67+
```go
68+
# TODO
69+
```
70+
71+
## Usage
2972

30-
## Node.js
73+
### Node.js
3174

3275
Install `interface-ipfs-core` as one of the dependencies of your project and as a test file. Then, using `mocha` (for Node.js) or a test runner with compatible API, do:
3376

@@ -47,17 +90,17 @@ var common = {
4790
test.all(common)
4891
```
4992

50-
## Go
93+
### Go
5194

5295
> WIP
5396
54-
# API
97+
## API
5598

5699
A valid (read: that follows this interface) IPFS core implementation, must expose the following API.
57100

58-
## Files
101+
### Files
59102

60-
### `add`
103+
#### `add`
61104

62105
> Add files and data to IPFS.
63106
@@ -105,7 +148,7 @@ ipfs.files.add(files, function (err, files) {
105148
```
106149

107150

108-
### `createAddStream`
151+
#### `createAddStream`
109152

110153
> Add files and data to IPFS using a transform stream.
111154
@@ -149,7 +192,7 @@ ipfs.files.createAddStream(function (err, stream) {
149192

150193

151194

152-
### `cat`
195+
#### `cat`
153196

154197
> Streams the file at the given IPFS multihash..
155198
@@ -175,9 +218,9 @@ ipfs.files.cat(multihash, function (err, file) {
175218

176219

177220

178-
## Object
221+
### Object
179222

180-
### `object.new`
223+
#### `object.new`
181224

182225
> Create a new MerkleDAG node, using a specific layout. Caveat: So far, only UnixFS object layouts are supported.
183226
@@ -193,7 +236,7 @@ If no `callback` is passed, a [promise][] is returned.
193236

194237

195238

196-
### `object.put`
239+
#### `object.put`
197240

198241
> Store an MerkleDAG node.
199242
@@ -219,7 +262,7 @@ If no `callback` is passed, a [promise][] is returned.
219262

220263

221264

222-
### `object.get`
265+
#### `object.get`
223266

224267
> Fetch a MerkleDAG node
225268
@@ -240,7 +283,7 @@ If no `callback` is passed, a [promise][] is returned.
240283

241284
If no `callback` is passed, a [promise][] is returned.
242285

243-
### `object.data`
286+
#### `object.data`
244287

245288
> Returns the Data field of an object
246289
@@ -260,7 +303,7 @@ If no `callback` is passed, a [promise][] is returned.
260303

261304
If no `callback` is passed, a [promise][] is returned.
262305

263-
### `object.links`
306+
#### `object.links`
264307

265308
> Returns the Links field of an object
266309
@@ -285,7 +328,7 @@ If no `callback` is passed, a [promise][] is returned.
285328

286329

287330

288-
### `object.stat`
331+
#### `object.stat`
289332

290333
> Returns stats about an Object
291334
@@ -321,17 +364,17 @@ If no `callback` is passed, a [promise][] is returned.
321364

322365

323366

324-
### `object.patch`
367+
#### `object.patch`
325368

326369
> `object.patch` exposes the available patch calls.
327370
328-
#### `object.patch.addLink`
371+
##### `object.patch.addLink`
329372

330373
> Add a Link to an existing MerkleDAG Object
331374
332-
##### `Go` **WIP**
375+
###### `Go` **WIP**
333376

334-
##### `JavaScript` - ipfs.object.patch.addLink(multihash, DAGLink, [options, callback])
377+
###### `JavaScript` - ipfs.object.patch.addLink(multihash, DAGLink, [options, callback])
335378

336379
`multihash` is a [multihash][] which can be passed as:
337380

@@ -352,13 +395,13 @@ If no `callback` is passed, a [promise][] is returned.
352395

353396

354397

355-
#### `object.patch.rmLink`
398+
##### `object.patch.rmLink`
356399

357400
> Remove a Link from an existing MerkleDAG Object
358401
359-
##### `Go` **WIP**
402+
###### `Go` **WIP**
360403

361-
##### `JavaScript` - ipfs.object.patch.rmLink(multihash, DAGLink, [options, callback])
404+
###### `JavaScript` - ipfs.object.patch.rmLink(multihash, DAGLink, [options, callback])
362405

363406
`multihash` is a [multihash][] which can be passed as:
364407

@@ -379,13 +422,13 @@ If no `callback` is passed, a [promise][] is returned.
379422

380423

381424

382-
#### `object.patch.appendData`
425+
##### `object.patch.appendData`
383426

384427
> Append Data to the Data field of an existing node.
385428
386-
##### `Go` **WIP**
429+
###### `Go` **WIP**
387430

388-
##### `JavaScript` - ipfs.object.patch.appendData(multihash, data, [options, callback])
431+
###### `JavaScript` - ipfs.object.patch.appendData(multihash, data, [options, callback])
389432

390433
`multihash` is a [multihash][] which can be passed as:
391434

@@ -406,13 +449,13 @@ If no `callback` is passed, a [promise][] is returned.
406449

407450

408451

409-
#### `object.patch.setData`
452+
##### `object.patch.setData`
410453

411454
> Reset the Data field of a MerkleDAG Node to new Data
412455
413-
##### `Go` **WIP**
456+
###### `Go` **WIP**
414457

415-
##### `JavaScript` - ipfs.object.patch.setData(multihash, data, [options, callback])
458+
###### `JavaScript` - ipfs.object.patch.setData(multihash, data, [options, callback])
416459

417460
`multihash` is a [multihash][] which can be passed as:
418461

@@ -429,7 +472,20 @@ If no `callback` is passed, a [promise][] is returned.
429472

430473
If no `callback` is passed, a [promise][] is returned.
431474

432-
433475
[DAGNode]: https://github.com/vijayee/js-ipfs-merkle-dag
434476
[multihash]: http://github.com/jbenet/multihash
435477
[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
478+
479+
## Contribute
480+
481+
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/interface-ipfs-core/issues)!
482+
483+
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
484+
485+
### Want to hack on IPFS?
486+
487+
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
488+
489+
## License
490+
491+
MIT

0 commit comments

Comments
 (0)