holepunchto / hyperdrive

Hyperdrive is a secure, real time distributed file system
Apache License 2.0
1.86k stars 135 forks source link

Pass though opts parameter to metadata hypertrie #301

Closed fsteff closed 1 year ago

fsteff commented 3 years ago

It would be useful to have the ability to pass through the opts parameter of createWriteStream, createReadstream etc. to the metadata db/hypertrie. This e.g. would make it possible to create hidden files by simple passing the hidden: true option.

However, according to @mafintosh this would result in internal clashes, therefore some namespacing is required (obviously, e.g. for the valueEncoding option).

So here's my suggestion for the options namespace:

{
  db: { /* opts passed to the db */ }
}

I'll try to implement it right away and create a pull request once it works ;-)

Discussion on Discord

fsteff commented 3 years ago

Possible limitations - the question here is if there would even be a usecase for it: