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

gophersheet

v0.0.1

Published

Serve your Gopherhole from Google Sheets

Downloads

1

Readme

GopherSheet

Serve your Gopherhole from a Google Sheet. Because why not?

Screenshot of a CLI Gopher client

Usage

To start serving up your Gopherhole, simply cd to a directory containing credentials.json and gopherhole.json files, and:

npx gophersheet

To obtain those files, you need to:

Setting up your Google account

Must be done once per each Google account

Before you can give GopherSheet access to your sheet, you need to create a service account. This is a special user account, with restricted access, for use by apps and scripts.

Follow the instructions here to set it up, then save the credentials.json file you got somewhere.

Creating and setting up your sheet

Must be done once per each spreadheet

Create a new Google Sheet, and share it with the service account you just created. You can find its email in the credentials.json file.

Instead of creating a sheet from scratch, you can also use one of the templates in the templates directory to get started. Remember to share it with the service account.

The spreadsheet does not need anything special, and it's in fact a straight representation of a traditional Gopherfile.

| Type | Title | Selector | Host | Port | | ---- | ------------- | --------- | ------------------- | ---- | | i | My gopherhole | | | | | i | | | | | | 1 | About me | /about | my.gopherhole.me | 70 | | 1 | My projects | /projects | my.gopherhole.me | 70 | | i | | | | | | 1 | My projects | / | gopher.floodgap.com | 70 |

Each tab in the sheet represents a different Gopher page. The name of the tab will be used as the selector when a client request a resource.

Apart from the mandatory header row, each row represents a single Gopher item: a text, a link to a file, to a website, or to another menu, and so on.

The first column should contain the type of that item. If left blank, type i will be used, which displays static text. You can find a list of common types here.

When linking to other Gopher resources (eg. type 0, 1, etc.), the Host and Port columns can point to a different Gopherhole. If left blank, they will default to your configured FQDN.

When creating www links (type h) the full URL must be typed in the selector column. Host and Port will be ignored.

Configuring the server

Create a gopherhole.json in the same directory you saved the credentials.json file earlier. Here's an example:

{
  "SHEET_ID": "---YOUR SHEET ID HERE---",
  "FQDN": "my.gopherhole.me",
  "ADDRESS": "::",
  "PORT": 70
}

You can extract the SHEET_ID from the URL of your Google Sheet:

https://docs.google.com/spreadsheets/d/abcdefghijklmnopqrstuvwxyz01234567890abcdefg/edit
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Create a domain and point it to your server. Specify it as the FQDN in the configuration file, so that GopherSheet can generate the correct links.

Rather than exposing GopherSheet directly (ie. by listening on :: or 0.0.0.0), you might front it with a proxy like Nginx or Caddy instead.

License

GopherSheet is licensed under the MIT license.