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

ipfs-cohost

v4.0.0

Published

A CLI to co-host websites published to IPFS

Downloads

9

Readme

ipfs-cohost 🌐✨🤝

A CLI to co-host websites published to IPFS.

If your domain has a DNSlink to a CID, then ipfs-cohost will let others pin it to their IPFS node.

Usage

Pass it the list of domains you want to cohost. It finds the CID from the DNSLink for that domain and starts cohosting the domains. By default, we use a full cohosting. You can force the domains to be lazily cohosted by using the flag --lazy.

$ ipfs-cohost add ipfs.io docs.ipfs.io awesome.ipfs.io
🔌 Using local ipfs daemon via http api
📍 docs.ipfs.io    QmNrbogjGZWgUSrbmHXydwc5b51oJQsBfHA2RkNRVf2ikc 6.86 MB
📍 awesome.ipfs.io QmPHrA6RT2j7bEcBrdeV2z6ZWrchDguw9wBchHPr6VZcFS 7.6 MB
📍 ipfs.io         QmYb3dbymigAPcaiQUgnPxbwgMKjvxVBrrxSvFHwbZLVkq 10 MB
📦 Total size 24.5 MB for 3 domains
🤝 Co-hosting 3 domains via IPFS.

Passing the --silent options will prevent any logging.

$ ipfs-cohost add ipfs.io --silent

Remove cohosted website

You can remove one or more websites at once:

$ ipfs-cohost rm ipfs.io docs.ipfs.io awesome.ipfs.io
🔌 Using local ipfs daemon via http api
✔  ipfs.io no longer cohosted.
✔  docs.ipfs.io no longer cohosted.
✔  awesome.ipfs.io no longer cohosted.

You can also remove every website you have cohosted:

$ ipfs-cohost rm --all
🔌 Using local ipfs daemon via http api
✔ All cohosted websites removed.

List cohosted websites and snapshots

Use ls with no arguments to list the cohosted domains:

$ ipfs-cohost ls
🔌 Using local ipfs daemon via http api
📍 Lazily cohosted domains:
      docs.ipfs.io
      ipfs.io
📍 Fully cohosted domains:
      arewedistributedyet.com
      awesome.ipfs.io
      ipfs.io

Use ls with domains as arguments to list the snapshots for each domain:

$ ipfs-cohost awesome.ipfs.io
🔌 Using local ipfs daemon via http api
⏱ Full snapshots for ipfs.io:
      2019-10-06_095057
      2019-10-05_135342

Sync the current domains

Check if you have the most up to date version of each website and updates the snapshots.

$ ipfs-cohost sync
🔌 Using local ipfs daemon via http api
✔  Snapshots synced!

Prune

Delete all snapshots but the last n. If n is not provided, all snapshots but the last one will be deleted.

$ ipfs-cohost prune [n]
🔌 Using local ipfs daemon via http api
✔  Cohosted websites cleaned!

Only add latest copies

In some situations, you might want to be able to provide a strict list of domains you want to have one and only snapshot per domain. You can use ipfs-cohost latest <domain>... as a short hand for ipfs-cohost rm --all && ipfs-cohost add <domain>.... All flags apply.

Could you do these with a few lines of bash?

Yes. All of this commands can be reproducible via bash commands. Please take a look at the cohosting SPEC to know which ipfs commands are equivalent to these ones.

Install

With node >= 10.15 and npm > 6.9 installed , you can install ipfs-cohost via npm

# install it
$ npm i -g ipfs-cohost

# run it
$ ipfs-cohost add docs.ipfs.io blog.ipfs.io ipfs.io

You can run the latest version of ipfs-cohost without explicitly installing it via npx

$ npx ipfs-cohost add docs.ipfs.io blog.ipfs.io ipfs.io