Skip to content

HopeTS/PearDriveCore-examples

Repository files navigation

PearDriveCore development basic examples

Tutorials showcasing the features of PearDrive Core

AGPL v3 License

🏗️ 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.

Getting Started

  1. Install dependencies through npm

    npm install
  2. 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.

Contents

If you are just starting to learn how to use PearDriveCore, these examples are listed in the recommended order they should be reviewed.

  1. Creating a network:

    # For node:
    npm run start-1
    
    # For pear:
    npm run start-1-pear
  2. 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
  3. 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
  4. Saving PearDrive

    # For node:
    npm run start-4
    
    # For pear:
    npm run start-4-pear
  5. 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
  6. 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published