Skip to content

Commit 3b587c2

Browse files
authored
docs: update readme and project (#227)
1 parent 6b8bb27 commit 3b587c2

File tree

3 files changed

+33
-40
lines changed

3 files changed

+33
-40
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
node_modules
2+
build
23
dist
34
.docs
45
.coverage
6+
node_modules
57
package-lock.json
68
yarn.lock
9+
.vscode

README.md

+30-36
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,24 @@
1212
- [Install](#install)
1313
- [Browser `<script>` tag](#browser-script-tag)
1414
- [Usage](#usage)
15-
- - [Create record](#create-record)
16-
- [Validate record](#validate-record)
17-
- [Embed public key to record](#embed-public-key-to-record)
18-
- [Extract public key from record](#extract-public-key-from-record)
19-
- [Datastore key](#datastore-key)
20-
- [Marshal data with proto buffer](#marshal-data-with-proto-buffer)
21-
- [Unmarshal data from proto buffer](#unmarshal-data-from-proto-buffer)
22-
- [Validator](#validator)
15+
- [Create record](#create-record)
16+
- [Validate record](#validate-record)
17+
- [Embed public key to record](#embed-public-key-to-record)
18+
- [Extract public key from record](#extract-public-key-from-record)
19+
- [Datastore key](#datastore-key)
20+
- [Marshal data with proto buffer](#marshal-data-with-proto-buffer)
21+
- [Unmarshal data from proto buffer](#unmarshal-data-from-proto-buffer)
22+
- [Validator](#validator)
2323
- [API](#api)
24-
- - [Create record](#create-record-1)
25-
- [Validate record](#validate-record-1)
26-
- [Datastore key](#datastore-key-1)
27-
- [Marshal data with proto buffer](#marshal-data-with-proto-buffer-1)
28-
- [Unmarshal data from proto buffer](#unmarshal-data-from-proto-buffer-1)
29-
- [Embed public key to record](#embed-public-key-to-record-1)
30-
- [Extract public key from record](#extract-public-key-from-record-1)
31-
- [Namespace](#namespace)
32-
- [Contribute](#contribute)
24+
- [Create record](#create-record-1)
25+
- [Validate record](#validate-record-1)
26+
- [Marshal data with proto buffer](#marshal-data-with-proto-buffer-1)
27+
- [Unmarshal data from proto buffer](#unmarshal-data-from-proto-buffer-1)
28+
- [Extract public key from record](#extract-public-key-from-record-1)
29+
- [Namespace](#namespace)
3330
- [API Docs](#api-docs)
3431
- [License](#license)
35-
- [Contribute](#contribute-1)
32+
- [Contribute](#contribute)
3633

3734
## Install
3835

@@ -50,21 +47,17 @@ Loading this module through a script tag will make it's exports available as `Ip
5047

5148
This module contains all the necessary code for creating, understanding and validating IPNS records.
5249

53-
## Lead Maintainer <!-- omit in toc -->
54-
55-
[Vasco Santos](https://github.com/vasco-santos).
56-
5750
## Usage
5851

59-
#### Create record
52+
### Create record
6053

6154
```js
6255
import * as ipns from 'ipns'
6356

6457
const entryData = await ipns.create(privateKey, value, sequenceNumber, lifetime)
6558
```
6659

67-
#### Validate record
60+
### Validate record
6861

6962
```js
7063
import * as ipns from 'ipns'
@@ -73,23 +66,23 @@ await ipns.validate(publicKey, ipnsEntry)
7366
// if no error thrown, the record is valid
7467
```
7568

76-
#### Embed public key to record
69+
### Embed public key to record
7770

7871
```js
7972
import * as ipns from 'ipns'
8073

8174
const ipnsEntryWithEmbedPublicKey = await ipns.embedPublicKey(publicKey, ipnsEntry)
8275
```
8376

84-
#### Extract public key from record
77+
### Extract public key from record
8578

8679
```js
8780
import * as ipns from 'ipns'
8881

8982
const publicKey = await ipns.extractPublicKey(peerId, ipnsEntry)
9083
```
9184

92-
#### Datastore key
85+
### Datastore key
9386

9487
```js
9588
import * as ipns from 'ipns'
@@ -101,7 +94,7 @@ Returns a key to be used for storing the ipns entry locally, that is:
10194

10295
/ipns/${base32(<HASH>)}
10396

104-
#### Marshal data with proto buffer
97+
### Marshal data with proto buffer
10598

10699
```js
107100
import * as ipns from 'ipns'
@@ -114,7 +107,7 @@ const marshalledData = ipns.marshal(entryData)
114107

115108
Returns the entry data serialized.
116109

117-
#### Unmarshal data from proto buffer
110+
### Unmarshal data from proto buffer
118111

119112
```js
120113
import * as ipns from 'ipns'
@@ -124,7 +117,7 @@ const data = ipns.unmarshal(storedData)
124117

125118
Returns the entry data structure after being serialized.
126119

127-
#### Validator
120+
### Validator
128121

129122
```js
130123
import * as ipns from 'ipns'
@@ -140,7 +133,7 @@ The `select` function is responsible for deciding which ipns record is the best
140133

141134
## API
142135

143-
#### Create record
136+
### Create record
144137

145138
```js
146139

@@ -168,7 +161,7 @@ Returns a `Promise` that resolves to an object with the entry's properties eg:
168161
}
169162
```
170163

171-
#### Validate record
164+
### Validate record
172165

173166
```js
174167
ipns.validate(publicKey, ipnsEntry)
@@ -181,7 +174,7 @@ Validate an IPNS record previously stored in a protocol buffer.
181174

182175
Returns a `Promise`, which may be rejected if the validation was not successful.
183176

184-
#### Marshal data with proto buffer
177+
### Marshal data with proto buffer
185178

186179
```js
187180
const marshalledData = ipns.marshal(entryData)
@@ -191,7 +184,7 @@ Returns the entry data serialized.
191184

192185
- `entryData` (Object): ipns entry record (obtained using the create function).
193186

194-
#### Unmarshal data from proto buffer
187+
### Unmarshal data from proto buffer
195188

196189
```js
197190
const data = ipns.unmarshal(storedData)
@@ -201,7 +194,7 @@ Returns the entry data structure after being serialized.
201194

202195
- `storedData` (Uint8Array): ipns entry record serialized.
203196

204-
#### Extract public key from record
197+
### Extract public key from record
205198

206199
```js
207200
const publicKey = await ipns.extractPublicKey(peerId, ipnsEntry)
@@ -214,7 +207,7 @@ Extract a public key from an IPNS entry.
214207

215208
Returns a `Promise` which resolves to public key ([`PublicKey`](https://github.com/libp2p/js-libp2p-interfaces/blob/master/packages/interface-keys/src/index.ts) ): may be used for cryptographic operations.
216209

217-
#### Namespace
210+
### Namespace
218211

219212
Namespace constants for records.
220213

@@ -229,6 +222,7 @@ ipns.namespaceLength
229222

230223
// 6
231224
```
225+
232226
## API Docs
233227

234228
- <https://ipfs.github.io/js-ipns>

package.json

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
"ipfs",
1717
"ipns"
1818
],
19-
"engines": {
20-
"node": ">=16.0.0",
21-
"npm": ">=7.0.0"
22-
},
2319
"type": "module",
2420
"types": "./dist/src/index.d.ts",
2521
"typesVersions": {

0 commit comments

Comments
 (0)