Skip to content

Commit 4d9a4fd

Browse files
authored
chore: update project config (#274)
1 parent 7ef0dd7 commit 4d9a4fd

File tree

5 files changed

+64
-77
lines changed

5 files changed

+64
-77
lines changed

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
; package-lock with tarball deps breaks lerna/nx - remove when https://github.com/semantic-release/github/pull/487 is merged
2+
package-lock=false

lerna.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
2-
"lerna": "5.4.0",
2+
"lerna": "6.0.1",
33
"useWorkspaces": true,
44
"version": "independent",
55
"command": {
66
"run": {
77
"stream": true
88
}
9-
},
10-
"packages": [
11-
"packages/*"
12-
]
9+
}
1310
}

packages/ipfs-unixfs-exporter/README.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13-
- [Lead Maintainer](#lead-maintainer)
14-
- [Usage](#usage)
15-
- [Example](#example)
16-
- [API](#api)
13+
- [Browser `<script>` tag](#browser-script-tag)
14+
- [Example](#example)
15+
- [API](#api)
1716
- [`exporter(cid, blockstore, options)`](#exportercid-blockstore-options)
18-
- [UnixFSEntry](#unixfsentry)
19-
- [Raw entries](#raw-entries)
20-
- [CBOR entries](#cbor-entries)
21-
- [`entry.content({ offset, length })`](#entrycontent-offset-length-)
17+
- [UnixFSEntry](#unixfsentry)
18+
- [Raw entries](#raw-entries)
19+
- [CBOR entries](#cbor-entries)
20+
- [`entry.content({ offset, length })`](#entrycontent-offset-length-)
2221
- [`walkPath(cid, blockstore)`](#walkpathcid-blockstore)
2322
- [`recursive(cid, blockstore)`](#recursivecid-blockstore)
2423
- [Contribute](#contribute)
@@ -31,13 +30,15 @@
3130
$ npm i ipfs-unixfs-exporter
3231
```
3332

34-
## Lead Maintainer
33+
### Browser `<script>` tag
3534

36-
[Alex Potsides](https://github.com/achingbrain)
35+
Loading this module through a script tag will make it's exports available as `IpfsUnixfsExporter` in the global namespace.
3736

38-
## Usage
37+
```html
38+
<script src="https://unpkg.com/ipfs-unixfs-exporter/dist/index.min.js"></script>
39+
```
3940

40-
### Example
41+
## Example
4142

4243
```js
4344
// import a file and export it again
@@ -78,7 +79,7 @@ for await (const buf of entry.content()) {
7879
console.info(bytes) // 0, 1, 2, 3
7980
```
8081

81-
#### API
82+
## API
8283

8384
```js
8485
import { exporter } from 'ipfs-unixfs-exporter'
@@ -94,7 +95,7 @@ Returns a Promise which resolves to a `UnixFSEntry`.
9495

9596
- `signal` ([AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)): Used to cancel any network requests that are initiated as a result of this export
9697

97-
#### UnixFSEntry
98+
### UnixFSEntry
9899

99100
```javascript
100101
{
@@ -127,7 +128,7 @@ if (entry.type === 'directory') {
127128
}
128129
```
129130
130-
#### Raw entries
131+
### Raw entries
131132
132133
Entries with a `raw` codec `CID` return raw entries:
133134
@@ -151,7 +152,7 @@ for await (const chunk of entry.content()) {
151152
152153
Unless you an options object containing `offset` and `length` keys as an argument to `entry.content()`, `chunk` will be equal to `entry.node`.
153154
154-
#### CBOR entries
155+
### CBOR entries
155156
156157
Entries with a `dag-cbor` codec `CID` return JavaScript object entries:
157158
@@ -167,7 +168,7 @@ Entries with a `dag-cbor` codec `CID` return JavaScript object entries:
167168

168169
There is no `content` function for a `CBOR` node.
169170

170-
#### `entry.content({ offset, length })`
171+
### `entry.content({ offset, length })`
171172

172173
When `entry` is a file or a `raw` node, `offset` and/or `length` arguments can be passed to `entry.content()` to return slices of data:
173174

packages/ipfs-unixfs-importer/README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13-
- [Lead Maintainer <!-- omit in toc -->](#lead-maintainer----omit-in-toc---)
14-
- [Usage](#usage)
15-
- [Example](#example)
16-
- [API](#api)
17-
- [const stream = importer(source, blockstore \[, options\])](#const-stream--importersource-blockstore--options)
13+
- [Browser `<script>` tag](#browser-script-tag)
14+
- [Example](#example)
15+
- [API](#api)
16+
- [const stream = importer(source, blockstore \[, options\])](#const-stream--importersource-blockstore--options)
1817
- [Overriding internals](#overriding-internals)
1918
- [Contribute](#contribute)
2019
- [License](#license)
@@ -26,13 +25,15 @@
2625
$ npm i ipfs-unixfs-importer
2726
```
2827

29-
## Lead Maintainer <!-- omit in toc -->
28+
### Browser `<script>` tag
3029

31-
[Alex Potsides](https://github.com/achingbrain)
30+
Loading this module through a script tag will make it's exports available as `IpfsUnixfsImporter` in the global namespace.
3231

33-
## Usage
32+
```html
33+
<script src="https://unpkg.com/ipfs-unixfs-importer/dist/index.min.js"></script>
34+
```
3435

35-
### Example
36+
## Example
3637

3738
Let's create a little directory to import:
3839

@@ -91,13 +92,13 @@ When run, metadata about DAGNodes in the created tree is printed until the root:
9192
}
9293
```
9394

94-
#### API
95+
## API
9596

9697
```js
9798
import { importer } from 'ipfs-unixfs-importer'
9899
```
99100

100-
#### const stream = importer(source, blockstore \[, options])
101+
### const stream = importer(source, blockstore \[, options])
101102

102103
The `importer` function returns an async iterator takes a source async iterator that yields objects of the form:
103104

packages/ipfs-unixfs/README.md

+30-44
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13-
- [Lead Maintainer <!-- omit in toc -->](#lead-maintainer----omit-in-toc---)
13+
- [Browser `<script>` tag](#browser-script-tag)
14+
- [Spec](#spec)
1415
- [Use in Node.js](#use-in-nodejs)
1516
- [Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler)
16-
- [Use in a browser Using a script tag](#use-in-a-browser-using-a-script-tag)
17-
- [Usage](#usage)
18-
- [Examples](#examples)
19-
- [Create a file composed by several blocks](#create-a-file-composed-by-several-blocks)
20-
- [Create a directory that contains several files](#create-a-directory-that-contains-several-files)
21-
- [API](#api)
22-
- - [UnixFS Data Structure](#unixfs-data-structure)
23-
- [create an unixfs Data element](#create-an-unixfs-data-element)
24-
- [add and remove a block size to the block size list](#add-and-remove-a-block-size-to-the-block-size-list)
25-
- [get total fileSize](#get-total-filesize)
26-
- [marshal and unmarshal](#marshal-and-unmarshal)
27-
- [is this UnixFS entry a directory?](#is-this-unixfs-entry-a-directory)
28-
- [has an mtime been set?](#has-an-mtime-been-set)
17+
- [Examples](#examples)
18+
- [Create a file composed by several blocks](#create-a-file-composed-by-several-blocks)
19+
- [Create a directory that contains several files](#create-a-directory-that-contains-several-files)
20+
- [UnixFS Data Structure](#unixfs-data-structure)
21+
- [create an unixfs Data element](#create-an-unixfs-data-element)
22+
- [add and remove a block size to the block size list](#add-and-remove-a-block-size-to-the-block-size-list)
23+
- [get total fileSize](#get-total-filesize)
24+
- [marshal and unmarshal](#marshal-and-unmarshal)
25+
- [is this UnixFS entry a directory?](#is-this-unixfs-entry-a-directory)
26+
- [has an mtime been set?](#has-an-mtime-been-set)
2927
- [Contribute](#contribute)
3028
- [License](#license)
3129
- [Contribute](#contribute-1)
@@ -36,16 +34,18 @@
3634
$ npm i ipfs-unixfs
3735
```
3836

39-
The UnixFS spec can be found inside the [ipfs/specs repository](http://github.com/ipfs/specs)
40-
41-
## Lead Maintainer <!-- omit in toc -->
37+
### Browser `<script>` tag
4238

43-
[Alex Potsides](https://github.com/achingbrain)
39+
Loading this module through a script tag will make it's exports available as `IpfsUnixfs` in the global namespace.
4440

45-
```sh
46-
> npm i ipfs-unixfs
41+
```html
42+
<script src="https://unpkg.com/ipfs-unixfs/dist/index.min.js"></script>
4743
```
4844

45+
## Spec
46+
47+
The UnixFS spec can be found inside the [ipfs/specs repository](http://github.com/ipfs/specs)
48+
4949
### Use in Node.js
5050

5151
```JavaScript
@@ -60,21 +60,9 @@ The code published to npm that gets loaded on require is in fact a ES5 transpile
6060
import { UnixFS } from 'ipfs-unixfs'
6161
```
6262

63-
### Use in a browser Using a script tag
63+
## Examples
6464

65-
Loading this module through a script tag will make the `UnixFS` obj available in the global namespace.
66-
67-
```html
68-
<script src="https://npmcdn.com/ipfs-unixfs/dist/index.min.js"></script>
69-
<!-- OR -->
70-
<script src="https://npmcdn.com/ipfs-unixfs/dist/index.js"></script>
71-
```
72-
73-
## Usage
74-
75-
### Examples
76-
77-
#### Create a file composed by several blocks
65+
### Create a file composed by several blocks
7866

7967
```JavaScript
8068
const data = new UnixFS({ type: 'file' })
@@ -83,17 +71,15 @@ data.addBlockSize(256)
8371
// ...
8472
```
8573

86-
#### Create a directory that contains several files
74+
### Create a directory that contains several files
8775

8876
Creating a directory that contains several files is achieve by creating a unixfs element that identifies a MerkleDAG node as a directory. The links of that MerkleDAG node are the files that are contained in this directory.
8977

9078
```JavaScript
9179
const data = new UnixFS({ type: 'directory' })
9280
```
9381

94-
## API
95-
96-
#### UnixFS Data Structure
82+
### UnixFS Data Structure
9783

9884
```protobuf
9985
syntax = "proto2";
@@ -128,7 +114,7 @@ message Metadata {
128114
}
129115
```
130116

131-
#### create an unixfs Data element
117+
### create an unixfs Data element
132118

133119
```JavaScript
134120
const data = new UnixFS([options])
@@ -148,7 +134,7 @@ const data = new UnixFS([options])
148134
- mode (Number, default `0644` for files, `0755` for directories/hamt-sharded-directories) file mode
149135
- mtime (`Date`, `{ secs, nsecs }`, `{ Seconds, FractionalNanoseconds }`, `[ secs, nsecs ]`): The modification time of this node
150136

151-
#### add and remove a block size to the block size list
137+
### add and remove a block size to the block size list
152138

153139
```JavaScript
154140
data.addBlockSize(<size in bytes>)
@@ -158,20 +144,20 @@ data.addBlockSize(<size in bytes>)
158144
data.removeBlockSize(<index>)
159145
```
160146

161-
#### get total fileSize
147+
### get total fileSize
162148

163149
```JavaScript
164150
data.fileSize() // => size in bytes
165151
```
166152

167-
#### marshal and unmarshal
153+
### marshal and unmarshal
168154

169155
```javascript
170156
const marshaled = data.marshal()
171157
const unmarshaled = Unixfs.unmarshal(marshaled)
172158
```
173159

174-
#### is this UnixFS entry a directory?
160+
### is this UnixFS entry a directory?
175161

176162
```JavaScript
177163
const dir = new Data({ type: 'directory' })
@@ -181,7 +167,7 @@ const file = new Data({ type: 'file' })
181167
file.isDirectory() // false
182168
```
183169

184-
#### has an mtime been set?
170+
### has an mtime been set?
185171

186172
If no modification time has been set, no `mtime` property will be present on the `Data` instance:
187173

0 commit comments

Comments
 (0)