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

mgnt

v0.3.1

Published

Extensible bittorrent client.

Downloads

1

Readme

                     o  
                     |  
    o-O-o o--o o-o  -o-
    | | | |  | |  |  |
    o o o o--O o  o  o  
             |          
          o--o          

Extensible bittorrent client. Built with webtorrent. Probably a bit buggy, as it's still an early prototype.

Install and usage

$ npm install mgnt -g
$ mgnt [path] # default ~/torrents/

Quit with q.

Extensions

ui

Provides a simple user interface.

list

Active transfer list.

input

Adds support for input (e.g. pasting torrents).

API

Core

core = new Core([path], [options])
/**
 * options: {
 *   dht: Boolean|Object,
 *   maxPeers: Number,
 *   nodeId: String|Buffer,
 *   peerId: String|Buffer,
 *   rtcConfig: Object,
 *   tracker: Boolean,
 *   wrtc: Object
 * }
 **/

Both path and options are optional.

References to torrent below refers to instances of webtorrent::torrent.

core.path

Default torrent download path.

core.client

An instance of webtorrent.

core.package

Contents of this module's package.json.

core.download(id)

Add id to client and begin downloading.

core.remove(id)

Remove id from client.

core.seed(input, options)

Begins seeding input.

core.extend(Extension)

Extend core with Extension (has to be a class).

core.round(number, precision)

Rounds number to precision. Returns the number as a string.

core.destroy

Destroys the client and exits the process.

Events

add

core.on('add', function(torrent) {
  // e.g. console.log(torrent.infoHash);
});

Emitted when a torrent has been successfully added to the client.

download

core.on('download',  function(torrent, chunkSize) {
  // e.g. console.log(torrent.downloadSpeed());
});

Emitted when a chunk of chunkSize has been successfully downloaded from torrent.

wire

core.on('wire', function(torrent, wire, addr) {
  // e.g. wire.use(myExtension);
});

Emitted whenever a new peer is connected to torrent. wire is an instance of bittorrent-protocol.

done

core.on('done', function(torrent) {
  // e.g. console.log(torrent.name);
});

Emitted when torrent has finished downloading.

seed

core.on('seed', function(torrent) {
  // e.g. console.log(torrent.uploaded);
});

Emitted when torrent has begun seeding.

error

core.on('error', function(error) {
  // e.g. throw error;
});

Emitted when an error occurs with the client.

Contribute

If you want to contribute with an extension, create a git repository with your code and send me a link or submit a pull request.

See Extensions above for examples.