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

Commit a85cfb9

Browse files
committed
Standardize README
See ipfs/community#124
1 parent 7af117d commit a85cfb9

File tree

2 files changed

+51
-14
lines changed

2 files changed

+51
-14
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Protocol Labs, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
IPFS API wrapper library in JavaScript
2-
======================================
1+
# js-ipfs-api
32

4-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) [![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs-api/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs-api?branch=master)
3+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
4+
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
5+
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
6+
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
7+
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs-api/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs-api?branch=master)
58
[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-api.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-api)
69
[![Travis CI](https://travis-ci.org/ipfs/js-ipfs-api.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs-api)
710
[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs-api.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs-api)
811

9-
> A client library for the IPFS API.
12+
> A client library for the IPFS HTTP API, implemented in JavaScript.
1013
11-
# Usage
14+
## Table of Contents
1215

13-
## Installing the module
16+
- [Install](#install)
17+
- [Running the daemon with the right port](#running-the-daemon-with-the-right-port)
18+
- [Importing the module and usage](#importing-the-module-and-usage)
19+
- [In the Browser through browserify](#in-the-browser-through-browserify)
20+
- [In the Browser through `<script>` tag](#in-the-browser-through-script-tag)
21+
- [CORS](#cors)
22+
- [Usage](#usage)
23+
- [Callbacks and promises](#callbacks-and-promises)
24+
- [Contribute](#contribute)
25+
- [License](#license)
1426

15-
### In Node.js Through npm
27+
## Install
28+
29+
This module uses node.js, and can be installed through npm:
1630

1731
```bash
1832
$ npm install --save ipfs-api
1933
```
34+
2035
**Note:** ipfs-api requires Node v4.x (LTS) or higher.
2136

22-
#### Running the daemon with the right port
37+
### Running the daemon with the right port
2338

2439
To interact with the API, you need to have a local daemon running. It needs to be open on the right port. `5001` is the default, and is used in the examples below, but it can be set to whatever you need.
2540

@@ -35,7 +50,7 @@ $ ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001
3550
$ ipfs daemon
3651
```
3752

38-
#### Importing the module and usage
53+
### Importing the module and usage
3954

4055
```javascript
4156
var ipfsAPI = require('ipfs-api')
@@ -74,7 +89,7 @@ If you omit the host and port, the api will parse `window.host`, and use this in
7489
var ipfs = window.IpfsApi()
7590
```
7691

77-
## CORS
92+
### CORS
7893

7994
If are using this module in a browser with something like browserify, then you will get an error saying that the origin is not allowed. This would be a CORS ("Cross Origin Resource Sharing") failure. The ipfs server rejects requests from unknown domains by default. You can whitelist the domain that you are calling from by changing your ipfs config like this:
8095

@@ -112,10 +127,10 @@ The js-ipfs API is a work in progress. As such, there's a few things you can do
112127
* **Add tests**. There can never be enough tests.
113128
* **Contribute to the [FAQ repository](https://github.com/ipfs/faq/issues)** with any questions you have about IPFS or any of the relevant technology. A good example would be asking, 'What is a merkledag tree?'. If you don't know a term, odds are, someone else doesn't either. Eventually, we should have a good understanding of where we need to improve communications and teaching together to make IPFS and IPN better.
114129

115-
## License
130+
**Want to hack on IPFS?**
116131

117-
MIT.
132+
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
118133

119-
# Want to hack on IPFS?
134+
## License
120135

121-
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)
136+
[MIT](LICENSE)

0 commit comments

Comments
 (0)