首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >实时读取数据块- node.js?

实时读取数据块- node.js?
EN

Stack Overflow用户
提问于 2013-06-12 06:33:50
回答 1查看 295关注 0票数 0

我在做网络分析。为了报告流量和用户信息,我想要read the flat file at real-time,平面文件由扩展日志格式中的用户信息组成。

需求

代码语言:javascript
复制
Reading the flat files at real-time which means, reading the particular chunk of data from the file and listening to the file for update if it is updated (new line or data added in the file) read the updated data and serve it for reporting.

相似

这种技术类似于unix系统中的尾部-f

已知

文件读取 in node.js

有任何与此要求类似的技术吗?

EN

回答 1

Stack Overflow用户

发布于 2013-06-12 07:32:08

有一个尾模块在内部使用fs.watchFilefs.createReadStream

在启动时,你只需“扔掉”你不需要的每一行。总之,这可能是最简单的方法.

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17059019

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档