-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
similar to level-js #15
Comments
I haven't. I don't really see a lot of overlap; I'm obviously open to code-sharing (hey, it's open source!), but level.js seems to be all about LevelDB. localforage aims to exist as a library on top of all the weird storage backends offered by various browsers, except with a common API. A quick glimpse at the level.js README doesn't mention localStorage as a fallback (nor would I expect it to). LevelDB, from what I can see, is some big thing Google does with an ecosystem; localforage is about client-side storage for browsers/web runtimes, nothing more. I... don't really get what you're saying, other than they're both client-side storage libraries. level.js seems more focused on IndexedDB/levelDB -- which probably makes it a BETTER, more PURE storage engine. localforage values compaitibility over what's best. I gather that makes us different enough projects. |
If this project's api implemented the abstract-leveldown api instead of its own custom not-quite-localStorage api, this could be a simple wrapper around levelup, which you'll notice has nearly the exact same public api: access: localStorage.getItem('key', fn);
level.get('key', fn); inserts: localStorage.setItem('key', JSON.stringify('value'), fn);
level.put('key', JSON.stringify('value'), fn); deletes: localStorage.removeItem('key', fn);
level.del('key', fn);
IndexedDB is just an implementation detail.
I guess I'm suggesting if you're going to all the bother of making a localStorage-kinda shim, with a public api that's almost exactly the same as the levelup api, then maybe it makes sense to combine forces and invest that energy into something that does the exact same thing but also benefits from compatibility with an ecosystem, rather than just going it alone. I know it's a bit of a pivot, just wanted to make sure it was on your radar. Food for thought. |
So I'm confused on this -- is this essentially asking to expose a LevelUp Shim for the existing API? If there's an API guide I can follow that would allow us to mostly map existing methods to the Level names with little extra code I guess I'm open to this, but I can't exactly tell what's up. Keep in mind, a pull request may help more than an issue. |
Having a LevelUP shim over localForage would be pretty neat. I'd be interested to try building PouchDB with localForage as the backend. :) If you'd like to get started, here's the API for LevelUP. And for a *DOWN project with working browser tests that pass the Abstract LevelDOWN suite in Testling, you can check out localstorage-down. |
After three years of not implementing this–I'm thinking we won't. I'd take a PR, but I'll say there's not enough interest in this when there are more pressing patches. Feel free to re-open if anyone disagrees! |
FWIW PouchDB also dropped level.js support in v5 (it was available via an add-on adapter). |
seen https://github.com/maxogden/level.js?
Perhaps you could consider some collaboration here or at least a mention in the readme since these are basically the same api except that level-js conforms to an interface that allows it to work with much of the existing leveldb ecosystem.
The text was updated successfully, but these errors were encountered: