npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gun-vue/relay

v0.5.0

Published

A one liner gun js server easy to run on any free tier nodejs cloud like **[Glitch.com](https://glitch.com/~etogun)**, www.heroku.com or others, on a private VPS server or any other device like RaspberryPi or simply an Android phone.

Downloads

10

Readme

A simple Gun DB relay peer

A one liner gun js server easy to run on any free tier nodejs cloud like Glitch.com, www.heroku.com or others, on a private VPS server or any other device like RaspberryPi or simply an Android phone.

@gun-vue logo

Run in a cloud for free

There's a plenty of cloud providers with free tiers suitable to the needs of running a Gun relay node.

More links to be added here later.

Run on any device

All you need to run a Gun relay is a NodeJS >=16.x environment with npm package manager to import and run the script. It's already up and running in major clouds, but you may need to install NodeJS on your computer, or configure a RaspberryPi.

  • Computer

    Open your terminal and check the version of Node with node -v. You may need to Install NodeJS or update it.

  • Android device

    You can easily run NodeJS apps on an Android phone with Termux app. Consider installing it from F-Droid to get the fresh and stable version.

  • RaspberryPi

    Flash your image and configure your Pi to run a local Gun server

How to use

  1. Run this in the command line and follow the steps to create a new NodeJS project
npm init
  1. Then install the package as a dependency
npm i @gun-vue/relay
  1. Add this line to the generated package.json file
"scripts": {
    "start": "node start.js"
  }
  1. Create a start.js script and edit it as follows:
  2. Import the relay and initiate it.
import relay from "@gun-vue/relay";

relay.init();
  1. Save the start.js and run it.
node start.js

You'll see the message from the relay server running with it's address to use as a Gun peer in your app:

Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!
AXE relay enabled!
Server started at http://localhost:4200/gun
Multicast on 233.255.255.255:8765

You've got your Gun relay up and running!

Options

You can use customize your server with an options object:

relay.init({
  host: "localhost", // A host name used by the server to publish it's state to the graph. Set your peer URL without a protocol, like  'relay.some-site.com'
  port: 4200, // Gun server port. You may use a more standard 8080.
  store: false, // Put true if you want to have Gun store data on disk.
  path: "public", // A public directory to expose your app with the build in express server. Insert a path like '../app/dist'
});

The options may be also set with .env file. The defaults are:

RELAY_HOST="localhost"
RELAY_STORE=false
RELAY_PORT=4200
RELAY_PATH="public"
RELAY_QR=false