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 🙏

© 2026 – Pkg Stats / Ryan Hefner

btspider

v0.1.0

Published

dht spider

Readme

介绍

本项目是在原p2pspider的基础上修改而来,整理一下原项目的代码,添加了babel,eslint,gulp等工具来支持es6代码。

demo程序:bt问问

新项目源码放在src,babel转译后的文件放在dist目录,源码统一改成es6 class格式,

本地测试

git clone https://github.com/callmelanmao/p2pspider

原来的测试文件也进行了修改,因为node.js不支持es6 module和es6 class,所以必须先运行gulp,然后执行node test-dist/index.js运行测试代码

import P2PSpider from '../dist';

const p2p = new P2PSpider();

p2p.ignore((infohash, rinfo, callback) => {
  // false => always to download the metadata even though the metadata is exists.
  const theInfohashIsExistsInDatabase = false;
  callback(theInfohashIsExistsInDatabase);
});

p2p.on('metadata', (metadata) => {
  console.log(metadata);
  const files = metadata.info.files || [];
  files.forEach((file) => {
    console.log(file.path.toString('utf8'));
  });
});

p2p.listen(6881, '0.0.0.0');

依赖测试

把这个项目添加到package.json的依赖中,"p2pspider": "https://github.com/callmelanmao/p2pspider",由于和原项目命名冲突,所以不能发布到npm仓库。

import P2PSpider from 'p2pspider';

const p2p = new P2PSpider();

p2p.ignore((infohash, rinfo, callback) => {
  // false => always to download the metadata even though the metadata is exists.
  const theInfohashIsExistsInDatabase = false;
  callback(theInfohashIsExistsInDatabase);
});

p2p.on('metadata', (metadata) => {
  console.log(metadata);
  const files = metadata.info.files || [];
  files.forEach((file) => {
    console.log(file.path.toString('utf8'));
  });
});

p2p.listen(6881, '0.0.0.0');

协议

bep_0005, bep_0003, bep_0010, bep_0009

提醒

不要拿这个爬虫爬取的数据分享到互联网, 因为很多敏感资源; 色情资源; 侵权资源. 否则后果自负喔!

许可证

MIT