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

chokidar code reading #143

Open
hjyssg opened this issue Dec 23, 2020 · 3 comments
Open

chokidar code reading #143

hjyssg opened this issue Dec 23, 2020 · 3 comments
Labels

Comments

@hjyssg
Copy link
Owner

hjyssg commented Dec 23, 2020

chokidar code reading:
下载repo
npm install
跑他的example.js就好了 挺方便

lib\nodefs-handler.js
_addToNodeFs
_handleRead
this.fsw._readdirp
readdirp()
_addToNodeFs (进行递归scan)

When we pass a function to process.nextTick(), we instruct the engine to invoke this function at the end of the current operation, before the next event loop tick starts:

可以加个sleep,给其他task 留cpu时间

ignore被调用两次 一次只看名字 一次带着stat
被ignore,文件就不会被get stat

_isIgnored
-》 this._userIgnored
-》 matchPatterns

https://stackoverflow.com/questions/17509669/how-to-install-an-npm-package-from-github-directly

@hjyssg
Copy link
Owner Author

hjyssg commented Dec 23, 2020

chokidar会去scan所有文件的star 现在其实是双重scan了

@hjyssg
Copy link
Owner Author

hjyssg commented Dec 23, 2020

@hjyssg
Copy link
Owner Author

hjyssg commented Dec 23, 2020

@hjyssg hjyssg added the note label Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant