惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
H
Help Net Security
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
博客园 - 叶小钗
Y
Y Combinator Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
C
Check Point Blog
Recent Announcements
Recent Announcements
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
B
Blog

博客园 - cndavy

如何在WINDOW环境下搭建ActivateMQ和zookeeper集群环境 Esp8266 例子 树莓派 安装 docker CSV 文件处理成 String[] ,网银下载的文本中使用逗号分割, 使用双引号标记字段. 使用String split 会出现把引号中的逗号识别的情况 例如 " ,,,, " , "aaa" 切换网卡的脚本 apache xampp 目录防止解析php FTPS 客户端 demo, WordPress搬家教程:换空间与换域名 sympy 的 符号计算的例子 Conda 简单使用 spoolsv.exe 无法启动 太阳高度角和方位角的计算 树莓派 3 alsa 声卡驱动 PHP 7 Xdebug 深深的坑 java 线性规划 和lingo 比较 Cannot find or open the PDB file问题的解决 Python Microsoft Visual C++ Compiler Package for Python 2.7 angular 调试 js (分 karms protractor / test e2e unit ) hbase scan 的例子
Node debug
cndavy · 2016-03-10 · via 博客园 - cndavy

node-inspector & 

node --debug-brk   test.js

在 chrome 中调试 

'use strict';

var P2PSpider = require('../lib');

var p2p = P2PSpider({
nodesMaxSize: 20, // be careful
maxConnections: 40, // be careful
timeout: 5000
});

p2p.ignore(function (infohash, rinfo, callback) {
// false => always to download the metadata even though the metadata is exists.
var theInfohashIsExistsInDatabase = false;
callback(theInfohashIsExistsInDatabase);
});
var fs = require('fs');
var path = require('path');
p2p.on('metadata', function (metadata) {
console.log(metadata);
var rec={};
rec._name=metadata.info['name'].toString();
rec.publisher=metadata.info['publisher'].toString();
rec.magnet=metadata.magnet;
var outp=JSON.stringify(rec);
fs.appendFile(path.join(__dirname, 'metadata.json'),JSON.stringify(outp)+'\n' , function (err) {
if (err) throw err;
console.log("Export metadata Success!");
});
});

p2p.listen(6881, '0.0.0.0');