Add missing import of process (#108)

* Add missing import of process

* Add missing (bare-)process

* Add missing (bare-)process

* Add missing (bare-)process
This commit is contained in:
Thomas Verstreken
2024-06-04 10:13:08 +02:00
committed by GitHub
parent f8936b1cdd
commit 03289a500d
4 changed files with 10 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ Create the `peer-app` project with the following commands:
mkdir peer-app
cd peer-app
pear init -y -t terminal
npm install hyperswarm hypercore-crypto b4a
npm install hyperswarm hypercore-crypto b4a bare-process
```
Alter the peer-app/index.js file to the following:
@@ -25,6 +25,7 @@ Alter the peer-app/index.js file to the following:
import Hyperswarm from 'hyperswarm'
import crypto from 'hypercore-crypto'
import b4a from 'b4a'
import process from 'bare-process'
const swarm = new Hyperswarm()
Pear.teardown(() => swarm.destroy())

View File

@@ -21,7 +21,7 @@ Create the `server-app` project with the following commands:
mkdir server-app
cd server-app
pear init -y -t terminal
npm install hyperdht b4a
npm install hyperdht b4a bare-process
```
Alter `server-app/index.js` to the following:
@@ -29,6 +29,7 @@ Alter `server-app/index.js` to the following:
```javascript
import DHT from 'hyperdht'
import b4a from 'b4a'
import process from 'bare-process'
const dht = new DHT()
@@ -57,13 +58,14 @@ Create the `client-app` project with the following commands:
mkdir client-app
cd client-app
pear init -y -t terminal
npm install hyperdht b4a
npm install hyperdht b4a bare-process
```
Alter `client-app/index.js` to the following:
``` javascript
import DHT from 'hyperdht'
import b4a from 'b4a'
import process from 'bare-process'
console.log('Connecting to:', process.argv[2])
const publicKey = b4a.from(process.argv[2], 'hex')

View File

@@ -165,7 +165,7 @@ In a new terminal, create the `bee-reader-app` project with these commands:
mkdir bee-reader-app
cd bee-reader-app
pear init -y -t terminal
npm install corestore hyperswarm hyperdrive debounceify b4a
npm install corestore hyperswarm hyperdrive debounceify b4a bare-process
```
Adjust the `bee-reader-app/index.js` file to:
@@ -176,6 +176,7 @@ import Corestore from 'corestore'
import Hyperbee from 'hyperbee'
import debounce from 'debounceify'
import b4a from 'b4a'
import process from 'bare-process'
// create a Corestore instance
const store = new Corestore(Pear.config.storage)

View File

@@ -164,7 +164,7 @@ Finally create a `core-reader-app` project:
mkdir core-reader-app
cd core-reader-app
pear init -y -t terminal
npm install corestore hyperswarm hyperbee b4a
npm install corestore hyperswarm hyperbee b4a bare-process
```
@@ -174,6 +174,7 @@ Alter the generated `core-reader-app/index.js` file to the following
import Hyperswarm from 'hyperswarm'
import Corestore from 'corestore'
import b4a from 'b4a'
import process from 'bare-process'
import { Node } from 'hyperbee/lib/messages.js'