j-holub / Node-MPV

A NodeJs Module for MPV Player
https://www.npmjs.com/package/node-mpv
MIT License
116 stars 73 forks source link

Could dependency cuid be replaced by a smaller one like uuid? #42

Closed AxelTerizaki closed 6 years ago

AxelTerizaki commented 6 years ago

Hello again :)

I'm trying to reduce my node_modules footprint and stumbled upon node-mpv's dependency cuid, which seems to be used to generate collision-free request IDs.

I'm not sure if the likeness of a collision when generating IDs is high or not in the case of node-mpv, but the cuid module is about 2,2Mb big.

Is it a big requirement, or could it be replaced with a smaller ID generator like uuid or randomstring ?

I could submit a pull request if you'd be okay with this.

j-holub commented 6 years ago

Hey there :)

yeah I thought about getting rid of cuid eventually as well. Preferably with some kind of own implementation to make Node-MPV completely dependency free but something else works as well.

The modules sends quite a lot of messages and it generates an ID for every message in my local version I'm working on (Promises and error messages for EVERYTHING :D ). But I don't think cuid is the only thing that can handle this.

I'd say the chance for collision are rather small, if you want to submit a pull request please go ahead, looking forward to it :)

AxelTerizaki commented 6 years ago

Done on #43

Forgot to mention the issue here though.

AxelTerizaki commented 6 years ago

Guess this can be closed :)