mmkal / handy-redis

A wrapper around node_redis with Promise and TypeScript support.
Apache License 2.0
172 stars 10 forks source link

wrong direction in npm page #272

Closed lumosmind closed 3 years ago

lumosmind commented 3 years ago

in npm page at top-right side npm i handy-redis

but in documentation npm install handy-redis redis

why don't you put redis into dependencies ?

or make all installing instructions like npm install handy-redis redis

mmkal commented 3 years ago

The npm i handy-redis instruction in the top right of the npm page is part of npmjs.com and isn't controlled by this package.

The reasons redis isn't in dependencies:

Is there some way you think the instructions should be clearer? I'd consider making it a peer dependency. I've held off on this so far because in my experience they're more headache than they're worth, with the current landscape of package managers.

lumosmind commented 3 years ago

I can understand. You want to create generic solution. But there is well known principle "Single Responsibility". You can create different packages for node_redis and ioredis as kind of abstraction layers . These abstraction layers use your generic solution as dependency under the hood. So your download rate increase with other two abstraction packages. And usage of these packages could be easy.

mmkal commented 3 years ago

Sure. I think "easy usage" is a good goal. I want to be sure it's as convenient to use as possible, so I agree it might be preferable to publish a separate package for ioredis (or deno) rather than let them pollute the API surface. So far they haven't IMO, even in the proposal PR.

If npm i handy-redis redis vs npm i handy-redis is the only extra work required, it's not a very high price to pay. Arguably it's actually beneficial, as it makes sure users are aware what they're using under the hood. If there are any other problems you've found with usage though, let me know and I'll look into them.

lumosmind commented 3 years ago

Maybe you can improve readme.md file to get attention of developers. Because they can think the package has some problems until read all of the readme.md file.