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

file / directory watcher #12

Open
dckc opened this issue Apr 20, 2024 · 1 comment · May be fixed by #13
Open

file / directory watcher #12

dckc opened this issue Apr 20, 2024 · 1 comment · May be fixed by #13

Comments

@dckc
Copy link
Contributor

dckc commented Apr 20, 2024

For example, an async iterator that advances every time a file is added to a directory.

@dckc
Copy link
Contributor Author

dckc commented Apr 20, 2024

I wonder how much of it can be built with generative AI. Let's be a little more explicit with the description and use it as a prompt:

As a developer, I want a JavaScript file watcher library module. It should let me make an async iterator that advances each time a file is added to a directory. The value should be an object with methods to get the file's name and to read the file contents. Choose an appropriate npm package for watching files at least on linux.

Stretch goals:

  1. The module should have a function to make objects representing directories. In addition to a method to get an async iterator as above, the objects should have a join(segment1, ...segments) method that returns an object representing a subdirectory.
  2. unify the directory and file APIs.
  3. use dependency injection for access to the filesystem (and in general, all IO).

@dckc dckc linked a pull request Apr 20, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant