mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 22:44:21 +01:00
Fix grammar in docs (#49)
* fix grammar in readme * fix grammar in compact-encoding * fix grammar in hyperdht * fix grammar in hyperdrive * fix grammar in hypercore * fix grammar in hyperswarm * fix grammar in localdrive * fix grammar in mirrordrive * fix grammar in sharing-a-pear-app * tiny fixes
This commit is contained in:
@@ -345,7 +345,7 @@ await core.clear(4) // clear block 4 from local cache
|
|||||||
await core.clear(0, 10) // clear block 0-10 from local cache
|
await core.clear(0, 10) // clear block 0-10 from local cache
|
||||||
```
|
```
|
||||||
|
|
||||||
The core will also 'gossip' with peers it is connected to, that is no longer has these blocks.
|
The core will also 'gossip' with peers it is connected to, that no longer have these blocks.
|
||||||
|
|
||||||
#### **`await core.truncate(newLength, [forkId])`**
|
#### **`await core.truncate(newLength, [forkId])`**
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ A range can have the following properties:
|
|||||||
To download the full core continuously (often referred to as non-sparse mode):
|
To download the full core continuously (often referred to as non-sparse mode):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Note that this will never be consider downloaded as the range
|
// Note that this will never be considered downloaded as the range
|
||||||
// will keep waiting for new blocks to be appended.
|
// will keep waiting for new blocks to be appended.
|
||||||
core.download({ start: 0, end: -1 })
|
core.download({ start: 0, end: -1 })
|
||||||
```
|
```
|
||||||
@@ -567,7 +567,7 @@ Emitted after the core has initially opened all its internal state.
|
|||||||
|
|
||||||
#### **`core.on('close')`**
|
#### **`core.on('close')`**
|
||||||
|
|
||||||
Emitted when the core has been fully closed
|
Emitted when the core has been fully closed.
|
||||||
|
|
||||||
#### **`core.on('peer-add')`**
|
#### **`core.on('peer-add')`**
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ const encryptedSocket = node.connect(remotePublicKey)
|
|||||||
| Property | Description | Type | Default |
|
| Property | Description | Type | Default |
|
||||||
| ------------- | -------------------------------------------------------- | ------ | --------------------- |
|
| ------------- | -------------------------------------------------------- | ------ | --------------------- |
|
||||||
| **`nodes`** | optional array of close dht nodes to speed up connecting | Array | `[]` |
|
| **`nodes`** | optional array of close dht nodes to speed up connecting | Array | `[]` |
|
||||||
| **`keyPair`** | optional key pair to use when connection | Object | `node.defaultKeyPair` |
|
| **`keyPair`** | optional key pair to use when connecting | Object | `node.defaultKeyPair` |
|
||||||
|
|
||||||
#### Properties
|
#### Properties
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ The public key of the [Hyperblobs](https://github.com/holepunchto/hyperblobs) in
|
|||||||
|
|
||||||
#### **`drive.version`**
|
#### **`drive.version`**
|
||||||
|
|
||||||
The number that indicates how many modifications were made, is useful as a version identifier.
|
The number that indicates how many modifications were made, it is useful as a version identifier.
|
||||||
|
|
||||||
#### **`drive.supportsMetadata`**
|
#### **`drive.supportsMetadata`**
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ Ban or unban the peer. Banning will prevent any future reconnection attempts, bu
|
|||||||
|
|
||||||
### Peer Discovery
|
### Peer Discovery
|
||||||
|
|
||||||
`swarm.join` returns a `PeerDiscovery` instance which allows for both the controlling of discovery behavior and responding to lifesycle changes during discovery.
|
`swarm.join` returns a `PeerDiscovery` instance which allows for both controlling discovery behavior and responding to lifecycle changes during discovery.
|
||||||
|
|
||||||
#### Methods
|
#### Methods
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function appendMessage ({ name, message }) {
|
|||||||
|
|
||||||
## Step 3. Run in dev mode
|
## Step 3. Run in dev mode
|
||||||
|
|
||||||
To test this chat app, in one terminal run `pear dev .`.
|
To test this chat app, in one terminal run `pear dev .`
|
||||||
|
|
||||||
The app will output something similar to:
|
The app will output something similar to:
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ The app will output something similar to:
|
|||||||
[info] Created new chat room: a1b2c35fbeb452bc900c5a1c00306e52319a3159317312f54fe5a246d634f51a
|
[info] Created new chat room: a1b2c35fbeb452bc900c5a1c00306e52319a3159317312f54fe5a246d634f51a
|
||||||
```
|
```
|
||||||
|
|
||||||
In another terminal use this key as input, `pear dev . a1b2c35fbeb452bc900c5a1c00306e52319a3159317312f54fe5a246d634f51a`.
|
In another terminal use this key as input, `pear dev . a1b2c35fbeb452bc900c5a1c00306e52319a3159317312f54fe5a246d634f51a`
|
||||||
|
|
||||||
The app will output:
|
The app will output:
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ This will output something similar to the following
|
|||||||
^_^ announced
|
^_^ announced
|
||||||
```
|
```
|
||||||
|
|
||||||
As long as the process is running the application is being seeded. If other peers reseed the application the original process could be closed. Be sure to keep the terminal open this process running.
|
As long as the process is running the application is being seeded. If other peers reseed the application the original process could be closed. Be sure to keep the terminal open while this process is running.
|
||||||
|
|
||||||
|
|
||||||
## Step 4. Run the app on another machine
|
## Step 4. Run the app on another machine
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ An object with the keys`{ start, end, buffer, cache }`.
|
|||||||
| `start` | Byte offset to start encoding/decoding at. |
|
| `start` | Byte offset to start encoding/decoding at. |
|
||||||
| `end` | Byte offset indicating the end of the buffer. |
|
| `end` | Byte offset indicating the end of the buffer. |
|
||||||
| `buffer` | Either a Node.js Buffer or Uint8Array. |
|
| `buffer` | Either a Node.js Buffer or Uint8Array. |
|
||||||
| `cache` | Used internally be codecs, starts as `null`. |
|
| `cache` | Used internally by codecs, starts as `null`. |
|
||||||
|
|
||||||
> Users can also get a blank state object using`cenc.state()`.
|
> Users can also get a blank state object using`cenc.state()`.
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ String with the resolved (absolute) drive path.
|
|||||||
|
|
||||||
**`drive.supportsMetadata`**
|
**`drive.supportsMetadata`**
|
||||||
|
|
||||||
Boolean that indicates if the drive handles or not metadata. Default `false`.
|
Boolean indicating whether the drive handles metadata. Default `false`.
|
||||||
|
|
||||||
If `options.metadata` hooks are passed then `supportsMetadata` becomes `true`.
|
If `options.metadata` hooks are passed then `supportsMetadata` becomes `true`.
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ console.log(mirror.count) // => { files: 0, add: 0, remove: 0, change: 0 }
|
|||||||
|
|
||||||
#### **`await mirror.done()`**
|
#### **`await mirror.done()`**
|
||||||
|
|
||||||
It starts processing all the diffing until is done.
|
It starts processing all the diffing until it is done.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const mirror = new MirrorDrive(src, dst)
|
const mirror = new MirrorDrive(src, dst)
|
||||||
|
|||||||
12
readme.md
12
readme.md
@@ -68,7 +68,7 @@ Notable features include:
|
|||||||
|
|
||||||
### Hyperswarm <mark style="background-color: #80ff80;">**stable**</mark>
|
### Hyperswarm <mark style="background-color: #80ff80;">**stable**</mark>
|
||||||
|
|
||||||
The [`hyperswarm`](./building-blocks/hyperswarm.md) module is a high-level API for finding and connecting to peers who are interested in a "topic."
|
The [`hyperswarm`](./building-blocks/hyperswarm.md) module is a high-level API for finding and connecting to peers who are interested in a "topic".
|
||||||
|
|
||||||
Notable features include:
|
Notable features include:
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ Notable features include:
|
|||||||
|
|
||||||
### Hyperdrive <mark style="background-color: #80ff80;">**stable**</mark>
|
### Hyperdrive <mark style="background-color: #80ff80;">**stable**</mark>
|
||||||
|
|
||||||
The [`hyperdrive`](./building-blocks/hyperdrive.md) module is a secure, real-time distributed file system that simplifies P2P file sharing that provides an efficient way to store and access data across multiple connected devices in a decentralized manner.
|
The [`hyperdrive`](./building-blocks/hyperdrive.md) module is a secure, real-time distributed file system that simplifies P2P file sharing. It provides an efficient way to store and access data across multiple connected devices in a decentralized manner.
|
||||||
|
|
||||||
* Uses Hyperbee internally for storing file metadata
|
* Uses Hyperbee internally for storing file metadata
|
||||||
* Major API simplification. Instead of mirroring POSIX APIs, the new API better captures the core requirements of P2P file transfer.
|
* Major API simplification. Instead of mirroring POSIX APIs, the new API better captures the core requirements of P2P file transfer.
|
||||||
@@ -90,8 +90,8 @@ The [`autobase`](./building-blocks/autobase.md) experimental module provides a "
|
|||||||
|
|
||||||
Notable features include:
|
Notable features include:
|
||||||
|
|
||||||
* automatic rebasing of multiple causally-linked Hypercores into a single, linearized Hypercore for multi-user collaboration
|
* Automatic rebasing of multiple causally-linked Hypercores into a single, linearized Hypercore for multi-user collaboration.
|
||||||
* low-friction integration into higher-level modules like Hyperbee and Hyperdrive: Autobase's output shares the familiar Hypercore API so peer-to-peer multi-user collaboration is achievable with little additional implementation effort.
|
* Low-friction integration into higher-level modules like Hyperbee and Hyperdrive: Autobase's output shares the familiar Hypercore API so peer-to-peer multi-user collaboration is achievable with little additional implementation effort.
|
||||||
|
|
||||||
> Autobase is still experimental and is likely to change significantly in the near future.
|
> Autobase is still experimental and is likely to change significantly in the near future.
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ The `hyperdht` module is the Distributed Hash Table (DHT) powering Hyperswarm. T
|
|||||||
|
|
||||||
Notable features include:
|
Notable features include:
|
||||||
|
|
||||||
* lower-level module provides direct access to the DHT for connecting peers using key pairs
|
* Lower-level module provides direct access to the DHT for connecting peers using key pairs.
|
||||||
|
|
||||||
## Helpers
|
## Helpers
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ Helper modules can be used together with the building blocks to create cutting-e
|
|||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
The following tools are used extensively employed in the day-to-day development and operation of applications built on Pear
|
The following tools are used extensively, employed in the day-to-day development and operation of applications built on Pear.
|
||||||
|
|
||||||
| Tools | Description |
|
| Tools | Description |
|
||||||
| :----------------------------------------------------------: | :---------------------------------------------------------: |
|
| :----------------------------------------------------------: | :---------------------------------------------------------: |
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ Media interface
|
|||||||
|
|
||||||
### `const status = await Pear.media.status.microphone()`
|
### `const status = await Pear.media.status.microphone()`
|
||||||
|
|
||||||
Resolves to: `<String>`.
|
Resolves to: `<String>`
|
||||||
|
|
||||||
If access to the microphone is available, resolved value will be `'granted'`.
|
If access to the microphone is available, resolved value will be `'granted'`.
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ Any other string indicates lack of permission. Possible values are `'granted'`,
|
|||||||
|
|
||||||
### `const status = await Pear.media.status.camera()`
|
### `const status = await Pear.media.status.camera()`
|
||||||
|
|
||||||
Resolves to: `<String>`.
|
Resolves to: `<String>`
|
||||||
|
|
||||||
If access to the camera is available, resolved value will be `'granted'`.
|
If access to the camera is available, resolved value will be `'granted'`.
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Any other fields (such as `dependencies`) may also be present in the `package.js
|
|||||||
|
|
||||||
The `package.json` `pear` object contains application configuration and is exposed via the API as `pear.config.options`.
|
The `package.json` `pear` object contains application configuration and is exposed via the API as `pear.config.options`.
|
||||||
|
|
||||||
Pear versioning is automatic. The `package.json` file does **not** require a version field, the version field will be ignored..
|
Pear versioning is automatic. The `package.json` file does **not** require a version field, the version field will be ignored.
|
||||||
|
|
||||||
## The `package.json` `pear` field.
|
## The `package.json` `pear` field.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user