Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement native monitoring documents | 实现原生的文件监控 #10271

Closed
vamsaya opened this issue Apr 15, 2024 · 1 comment
Closed

Implement native monitoring documents | 实现原生的文件监控 #10271

vamsaya opened this issue Apr 15, 2024 · 1 comment
Labels
bug Something isn't working needs repro Needs an example to reproduce node.js Compatibility with Node.js APIs

Comments

@vamsaya
Copy link

vamsaya commented Apr 15, 2024

What is the problem this feature would solve?

import { watch } from "fs/promises";

for await (const event of watch('.', { recursive: true })) {
    console.log(event);
}

Nodejs's Watch function is not easy to use. Windows11 WSL2 When creating a file, the rename event will be triggered, and the content of the file is modified, but it cannot trigger the Change event. Is this the defect of design?

In addition, the creation and deletion files will trigger the rename event. Obviously it is not easy to determine what the file is currently in. I hope that the Bun team can native Watch API.

When creating a file, the Create event is triggered.

When modifying the file, trigger the change event.

When renamed, Rename was triggered.

When deleting files, the remove event is triggered.

nodejs的watch功能并不好用,当创建文件时会触发rename事件,然后修改这个文件内容,却不能触发change事件,这是设计的缺陷吗?

另外,创建和删除文件都会触发rename事件,显然不好确定文件当前处于什么状态,希望bun团队能原生实现watch api。
创建文件时,触发create事件。
修改文件时,触发change事件。
重命名时,触发rename。
删除文件时,触发remove事件。

What is the feature you are proposing to solve the problem?

file watch

What alternatives have you considered?

No response

@vamsaya vamsaya added the enhancement New feature or request label Apr 15, 2024
@Electroid Electroid added bug Something isn't working node.js Compatibility with Node.js APIs needs repro Needs an example to reproduce and removed enhancement New feature or request labels Apr 15, 2024
@Electroid
Copy link
Contributor

Duplicate of #5841

@Electroid Electroid marked this as a duplicate of #5841 Apr 15, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs an example to reproduce node.js Compatibility with Node.js APIs
Projects
None yet
Development

No branches or pull requests

2 participants