You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[The unixfs spec can be found inside the ipfs/specs repository](http://github.com/ipfs/specs)
14
15
15
-
# Installation
16
-
17
-
## npm
16
+
## Table of Contents
17
+
18
+
-[Install](#install)
19
+
-[npm](#npm)
20
+
-[Use in Node.js](#use-in-nodejs)
21
+
-[Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler)
22
+
-[Use in a browser Using a script tag](#use-in-a-browser-using-a-script-tag)
23
+
-[Usage](#usage)
24
+
-[Examples](#examples)
25
+
-[Create a file composed by several blocks](#create-a-file-composed-by-several-blocks)
26
+
-[Create a directory that contains several files](#create-a-directory-that-contains-several-files)
27
+
-[API](#api)
28
+
-[unixfs Data Structure](#unixfs-data-structure)
29
+
-[create an unixfs Data element](#create-an-unixfs-data-element)
30
+
-[add and remove a block size to the block size list](#add-and-remove-a-block-size-to-the-block-size-list)
31
+
-[get total fileSize](#get-total-filesize)
32
+
-[marshal and unmarshal](#marshal-and-unmarshal)
33
+
-[Contribute](#contribute)
34
+
-[License](#license)
35
+
36
+
## Install
37
+
38
+
### npm
18
39
19
40
```sh
20
41
> npm i ipfs-unixfs
21
42
```
22
43
23
-
## Use in Node.js
44
+
###Use in Node.js
24
45
25
46
```JavaScript
26
47
var Unixfs =require('ipfs-unixfs')
27
48
```
28
49
29
-
## Use in a browser with browserify, webpack or any other bundler
50
+
###Use in a browser with browserify, webpack or any other bundler
30
51
31
52
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.
32
53
33
54
```JavaScript
34
55
var Unixfs =require('ipfs-unixfs')
35
56
```
36
57
37
-
## Use in a browser Using a script tag
58
+
###Use in a browser Using a script tag
38
59
39
60
Loading this module through a script tag will make the `Unixfs` obj available in the global namespace.
40
61
@@ -44,9 +65,9 @@ Loading this module through a script tag will make the `Unixfs` obj available in
0 commit comments