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

webtorrentify-github-release

v0.0.4

Published

Generate a .torrent file corresponding to a particular Github Release

Downloads

2

Readme

webtorrentify-github-release ALPHA

Generate a .torrent file corresponding to a particular Github Release

Why?

Distributing your application over WebTorrent/BitTorrent is cool! 😎

It can improve reliability and save money:

  • Your application can still be downloaded if Github gets blocked, goes down, or kicks you off*
  • You save Github 💲 by placing less demand on Github's AWS storage servers! ❤️

* as long as the torrent is being seeded

How?

This tool makes it easy to add a .torrent file to your existing Github Releases!

It downloads the files associated with a particular Github Release and creates a torrent file for them. If you provide a Github OAuth token in the environment variable, it will add the torrent file to your release for you.

You don't even have to add any new code or change your CI deployment process. You can try it first and see if you like it, and only automate it later.

TODO: Simplify seeding the result.

Installation

npm install webtorrentify-github-release --global

Usage

webtorrentify-github-release [owner] [repo] [version] [--upload]

If you don't specify owner, repo, or version it will try to obtain them from package.json in the current working directory.

Otherwise

  • owner is the Github username or name.
  • repo is the repository name.
  • version is the release to use. It must exactly match the git tag.

If --upload is used, it will create a Github OAuth token using ghauth or reuse one previously saved by gh-release, and use putasset to upload the .torrent file to your release.

The Github Release files are downloaded to a temporary directory and deleted afterwards. The torrent file is saved in the current working directory and named ${repo}-${version}.torrent. If there was a problem it will exit with a non-zero exit code.

Examples

> cd mymodule
> webtorrentify-github-release
Downloading wmhilton/[email protected]...
RELEASES                 ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 0.0s
Skipping upload to Github because the --upload flag wasn\'t used.
> ls
mymodule-v0.0.2.torrent

Publishing torrent to Github the first time:

> webtorrentify-github-release --upload
Downloading wmhilton/[email protected]...
RELEASES                 ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 0.0s
Your GitHub username: wmhilton
Your GitHub password: ✔✔✔✔✔✔✔✔✔

Your GitHub OTP/2FA Code (optional): ******
Uploaded .torrent to Github.

Subsequent usage:

> webtorrentify-github-release --upload
Downloading wmhilton/[email protected]...
RELEASES                 ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 0.0s
Uploaded .torrent to Github.

Automated usage

Install it as a dev dependency and add a script in your package.json

"devDependencies": {
  "webtorrentify-github-release": "1.x"
},
"scripts": {
  "deploy:torrent": "webtorrentify-github-release"
}

Then you can run it using "npm run deploy:torrent".

License

Copyright 2017 William Hilton. Licensed under The Unlicense.