Hi there!
While I'm quite impressed by the technical prowess of this package, aren't some of the methods a bit over-engineered?
For example, the most basic usage of this package is (as per the readme)
(async () => {
localStorage.clear();
const api = new API({
key: "ADD YOUR KEY HERE"
});
const stream = await api.createStream("search/banaan{5}");
stream
.pipe(stringify)
.pipe(console.log)
.catch(console.error);
})();
however, I feel like the (internal package) API could be way simpler by using a syntax like:
const api = new API({ key: "" });
api.search("banaan")
.then(console.log)
.catch(console.error);
you could then provide method shorthands for the available endpoints:
/search
/details
/refine
/schema
/index
/availability
/holdings
/resolver
Again, great job on all the fancy features! I'm a big fan of experimenting with these kind of things, and the minor is the perfect time to do it. I would be the last person to argue otherwise.
That being said, in a real-life use scenario, you don't need all the fancy options. I would even argue that it adds a whole lot of confusion for new users while it doesn't add much in terms of benefits.