Best way to persist plugin-specific data

What is the best way to persist some extra data specific to a plugin where the volume might be arbitrarily large.
To give an example, I was looking into building a plugin to provide full text search in resources, how to best store the index?
I tried using a separate SQLite database but turns out using a native module like SQLite with webpack is not trivial.
Appreciate any ideas.

I tried using a separate SQLite database but turns out using a native module like SQLite with webpack is not trivial.

The app is packaged with SQLite so I could give access to the module, like it's already done for fs-extra.

There's also a simple key/value store that could be exposed to plugin. Would that work for your plugin?

I guess it should work.
At some point I'd like to try writing a plugin in Rust compiled to WebAssembly, and I imagine I'll face similar issues then, but that's another story.

I wanted to use sqlite's FTS capabilites, so this won't help.

Then you may have to bundle an embedded database separately, such as SQLite / H2. As for the trouble... Nodejs native modules are troublesome