Solvedlevelup InitializationError: Must provide a location for the database

I got this error. Here is my code

const db = levelup(enc(leveldown('./testdb')));

please help

8 Answers

✔️Accepted Answer

For everyone, who does not want to use level for some reason:

Most of the documentation has already been updated for levelup's 2.0 release, which is at the time of writing only available as a pre-release on npm. As soon as the 2.0 is released, the above const db = levelup(enc(leveldown('./testdb'))); should work.

Until then the following code should work:

const db = levelup('./testdb', { db: leveldown });

Other Answers:

@0x530302 Thanks for clarifying this. It's a bit unfortunate that the current master branch is showing docs for the coming release. I'll focus on the README this week and hopefully get 2.0.0 out asap.

More Issues: