Skip to content

Commit

Permalink
Standardized Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLitt authored and daviddias committed Sep 7, 2016
1 parent 4222846 commit 45dc630
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 42 deletions.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Protocol Labs Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
116 changes: 74 additions & 42 deletions README.md
Expand Up @@ -2,16 +2,38 @@ js-multiaddr
============

[![](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/project-multiformats-blue.svg?style=flat-square)](http://github.com/multiformats/multiformats)
[![](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/jbenet/js-multiaddr/badge.svg?branch=master)](https://coveralls.io/github/jbenet/js-multiaddr?branch=master)
[![Travis CI](https://travis-ci.org/jbenet/js-multiaddr.svg?branch=master)](https://travis-ci.org/jbenet/js-multiaddr)
[![Circle CI](https://circleci.com/gh/jbenet/js-multiaddr.svg?style=svg)](https://circleci.com/gh/jbenet/js-multiaddr)
[![Dependency Status](https://david-dm.org/jbenet/js-multiaddr.svg?style=flat-square)](https://david-dm.org/jbenet/js-multiaddr) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)

> JavaScript implementation of [multiaddr](https://github.com/jbenet/multiaddr).
> JavaScript implementation of [multiaddr](https://github.com/multiformats/multiaddr).
## What is multiaddr?
## Table of Contents

- [Background](#background)
- [What is multiaddr?](#what-is-multiaddr)
- [Install](#install)
- [Setup](#setup)
- [Node.js](#nodejs)
- [Browser: Browserify, Webpack, other bundlers](#browser-browserify-webpack-other-bundlers)
- [Browser: `<script>` Tag](#browser-script-tag)
- [Usage](#usage)
- [API](#api)
- [Create](#create)
- [Protocols](#protocols)
- [Node-Friendly Addresses](#node-friendly-addresses)
- [En/decapsulate](#endecapsulate)
- [Tunneling](#tunneling)
- [Maintainers](#maintainers)
- [Contribute](#contribute)
- [License](#license)

## Background

### What is multiaddr?

A standard way to represent addresses that

Expand All @@ -21,7 +43,47 @@ A standard way to represent addresses that
- have a nice string representation
- encapsulate well

## Example
## Install

```sh
npm i multiaddr
```

### Setup

#### Node.js

```js
const multiaddr = require('multiaddr')
```

#### Browser: Browserify, Webpack, other bundlers

The code published to npm that gets loaded on require is in fact a ES5
transpiled version with the right shims added. This means that you can require
it and use with your favourite bundler without having to adjust asset management
process.

```js
const multiaddr = require('multiaddr')
```

#### Browser: `<script>` Tag

Loading this module through a script tag will make the `Multiaddr` obj available in
the global namespace.

```html
<script src="https://npmcdn.com/multiaddr/dist/index.min.js"></script>
<!-- OR -->
<script src="https://npmcdn.com/multiaddr/dist/index.js"></script>
```

**NOTE**: You will need access to the Node.js `Buffer` API. If you are running
in the browser, you can access it with `multiaddr.Buffer` or you can install
[feross/buffer](https://github.com/feross/buffer).

## Usage

```js
$ node
Expand Down Expand Up @@ -197,48 +259,18 @@ const printerOverProxy = proxy.encapsulate(printer)

Returns `true` if the passed in `addr` is a valid `multiaddr`.

## Installation
## Maintainers

### npm
Captain: [@diasdavid](https://github.com/diasdavid).

```sh
> npm i multiaddr
```
## Contribute

## Setup
Contributions welcome. Please check out [the issues](https://github.com/multiformats/js-multiaddr/issues).

### Node.js
Check out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

```js
const multiaddr = require('multiaddr')
```

### Browser: Browserify, Webpack, other bundlers

The code published to npm that gets loaded on require is in fact a ES5
transpiled version with the right shims added. This means that you can require
it and use with your favourite bundler without having to adjust asset management
process.

```js
const multiaddr = require('multiaddr')
```

### Browser: `<script>` Tag

Loading this module through a script tag will make the `Multiaddr` obj available in
the global namespace.

```html
<script src="https://npmcdn.com/multiaddr/dist/index.min.js"></script>
<!-- OR -->
<script src="https://npmcdn.com/multiaddr/dist/index.js"></script>
```

**NOTE**: You will need access to the Node.js `Buffer` API. If you are running
in the browser, you can access it with `multiaddr.Buffer` or you can install
[feross/buffer](https://github.com/feross/buffer).
Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

# License
## License

MIT
[MIT](LICENSE) © Protocol Labs Inc.

0 comments on commit 45dc630

Please sign in to comment.