Open alex3165 opened 7 years ago
@alex3165 oh very interesting. I've actually started on a better version (cleaned up, Rx5, ES6), but haven't had time to work on it lately. Would it help if I pushed that branch to GH? I wouldn't mind migrating the new stuff to TS if you're keen.
Hey, yes happy to merge it with your branch 👍 if you can push to GH that would be awesome.
And I think it make sense to write it using typescript as rxjs is written in typescript and peoples will benefit of the type definition files for free.
That's fine, TS just isn't the language I prefer when I'm dev'ing solo, but happy to collaborate if you want to contribute the build and deploy steps.
@alex3165 pushed to https://github.com/trxcllnt/rxjs-fs/tree/rxjs5
Let me know if there's anything I can clarify beyond these notes:
flatMap
etc., yet still access the FileSystem
class's instance methods.FileSystem.dir('./').stats().file()
will emit Objects with a { path, stats, file }
shape (assuming ./
has any files). Each wrapper Object should at least have a path
. This way instance methods can be lossless-ly chained without breaking the Observable comprehension.stats
, lstats
and fstats
instance methods check the incoming value and to avoid calling the FS stat
method redundantly. This may be an unsafe assumption, or it may be necessary to cache stats by path inside the monad.src/__tests__
) as Jest snapshot tests via babel-jest
. I'm not sure if Jest supports TS, but feel free to change the config if it does.@alex3165 just added a few more tests.
Also more instance methods need to be added (and file()
needs to be renamed to readFile()
) for most fs
operation that can be run on a path. I'm thinking exists
, unlink
, mkdir
, etc.
I have started an udpate of your library using typescript, if you are interested about it once I am done I can create a Pull Request, let me know.
https://github.com/alex3165/rxjs-fs
Also I think we should get rid of lodash as a dependency