Re: A JavaScript library for reading and writing to files?

i had some feedback on this off-list

I was pointed two two libraries to edit json config files

[1] https://github.com/mozilla/node-convict
[2] https://github.com/davidtheclark/cosmiconfig

also kingsley has suggested

"the source code of our OSDS doesn't reveal how to write to file:, http:,
or sparql-compliant DBMS targets? "

https://chrome.google.com/webstore/detail/openlink-structured-data/egdaiaihbdoiibopledjahjaihbmjhdj

currently I think a proxy method would be quite compelling for use cases I
have in mind

the idea would be a simple one, a library with two methods, "read" and
"write" (to a URI) which would work over multiple protocols with various
options (e.g for auth)

I namespace for this

https://www.npmjs.com/package/rww

it should be multi protocol, first of all dealing with http(s): and file:
but more could be added, basically by introspecing on the uri which would
be a passed parameter, then as the data changes, that is propagated to
persistent storage

lmk (on or off-list) if anyone is interested in scoping out such a library



On Thu, 23 Sept 2021 at 16:11, Melvin Carvalho <melvincarvalho@gmail.com>
wrote:

> Looking for a simple library here that simply reads and writes to the file
> system
>
> So you import a JSON file
>
> Then you change it and the changes are automatically written to the file
> system
>
> It would be possible to write a simple library to do this, perhaps using a
> JS Proxy [1], but I wonder if anything exists already?
>
> [1]
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
>

Received on Saturday, 25 September 2021 13:57:01 UTC