|
| 1 | +# ipfs-mfs JavaScript Implementation |
| 2 | + |
| 3 | +[](http://ipn.io) |
| 4 | +[](http://ipfs.io/) |
| 5 | +[](http://webchat.freenode.net/?channels=%23ipfs) |
| 6 | +[](https://github.com/RichardLitt/standard-readme) |
| 7 | +[](https://travis-ci.org/ipfs/js-ipfs-mfs) |
| 8 | +[](https://coveralls.io/github/ipfs/js-ipfs-mfs?branch=master) |
| 9 | +[](https://david-dm.org/ipfs/js-ipfs-mfs) |
| 10 | +[](https://github.com/feross/standard) |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +> JavaScript implementation of the IPFS Mutable File System |
| 15 | +
|
| 16 | +[The MFS spec can be found inside the ipfs/specs repository](https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/FILES.md#mutable-file-system) |
| 17 | + |
| 18 | +## Table of Contents |
| 19 | + |
| 20 | +- [Install](#install) |
| 21 | + - [npm](#npm) |
| 22 | + - [Use in Node.js](#use-in-nodejs) |
| 23 | + - [Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler) |
| 24 | + - [Use in a browser Using a script tag](#use-in-a-browser-using-a-script-tag) |
| 25 | +- [Contribute](#contribute) |
| 26 | +- [License](#license) |
| 27 | + |
| 28 | +## Install |
| 29 | + |
| 30 | +### npm |
| 31 | + |
| 32 | +```sh |
| 33 | +> npm i ipfs-mfs |
| 34 | +``` |
| 35 | + |
| 36 | +### Use in Node.js |
| 37 | + |
| 38 | +```JavaScript |
| 39 | +const mfs = require('ipfs-mfs') |
| 40 | +``` |
| 41 | + |
| 42 | +### Use in a browser with browserify, webpack or any other bundler |
| 43 | + |
| 44 | +The code published to npm that gets loaded on require is an 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. |
| 45 | + |
| 46 | +```JavaScript |
| 47 | +const mfs = require('ipfs-mfs') |
| 48 | +``` |
| 49 | + |
| 50 | +### Use in a browser using a script tag |
| 51 | + |
| 52 | +Loading this module through a script tag will make the `mfs` obj available in the global namespace. |
| 53 | + |
| 54 | +```html |
| 55 | +<script src="https://npmcdn.com/ipfs-mfs/dist/index.min.js"></script> |
| 56 | +<!-- OR --> |
| 57 | +<script src="https://npmcdn.com/ipfs-mfs/dist/index.js"></script> |
| 58 | +``` |
| 59 | + |
| 60 | +## Contribute |
| 61 | + |
| 62 | +All are welcome, please join in! Open an [issue](https://github.com/ipfs/js-ipfs-mfs/issues) or send a [PR](https://github.com/ipfs/js-ipfs-mfs/pulls)! |
| 63 | + |
| 64 | +This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). |
| 65 | + |
| 66 | +[](https://github.com/ipfs/community/blob/master/contributing.md) |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +[MIT](LICENSE) |
0 commit comments