Tutorials showcasing the features of PearDrive Core
🏗️ Up to date as of core 3.0.0
PearDriveCore is compatible with node.js and Pear Runtime environments. You can look in the package.json of an example project to see how mapping the node.js and Bare shims, which is necessary for running in Pear Runtime.
-
Install dependencies through npm
npm install
-
Run the corresponding commands for each lesson listed below
I recommend having the code on the left and the terminal on the right, so you can follow along the comments and code and see how they correlate to the output. This repo is very hand holdy, you should have a strong grasp on PearDriveCore's features by the end.
If you are just starting to learn how to use PearDriveCore, these examples are listed in the recommended order they should be reviewed.
-
Creating a network:
- File: ~/1-two-peer-network.js
- Description: Breaks down how to create a network of PearDrive instances
# For node: npm run start-1 # For pear: npm run start-1-pear
-
Messaging
- File: ~/2-messaging.js
- Description: Breaks down the messaging system, for arbitrary communication between PearDrive instances on the same network.
# For node: npm run start-2 # For pear: npm start-2-pear
-
File Transfers
- File: ~/3-file-transfers.js
- Description: Breaks down how transferring files between peers on the network works.
# For node: npm run start-3 # For pear: npm run start-3-pear
-
Saving PearDrive
- File: ~/4-saving-peardrive.js
- Description: How to save and reload a PearDrive instance.
# For node: npm run start-4 # For pear: npm run start-4-pear
-
View Data
- File: ~/5-view-data.js
- Description: View information about peers and files on the network.
# For node: npm run start-5 # For pear: npm run start-5-pear
-
Event Listeners
- File: ~/6-event-listeners.js
- Description:Learn how to use event listeners to create a responsive app that will react to dynamic changes on the PearDrive network.
# For node: npm run start-6 # For pear: npm run start-6-pear