Closed webdesserts closed 6 years ago
Ok that's a mistake in the docs. The options param needs to be documented.
The behavior is different between node and the browser but only slightly (which may be a bad thing). The name/path param is always optional. If you dont specify it in node, it just defaults to a local webdb
directory.
In the api docs the constructor has the signature
new WebDB([name])
. However, in the initial nodejs example it has what looks to be the signaturenew WebDB(path[, options])
. I see a mention of thepath
, but I don't see anything about theoptions
. Also is thepath
still optional in node?Side Note: these types of environment dependent dynamic signatures are kind of a pain in the ass to work with in typed pre-processors like Typescript & Flow (edit: specifically if
name
is optional andpath
is required in this specific case).