50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
305 stars 55 forks source link

Avoids deprecation warning using Buffer #87

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hopefully this is useful - I was getting a deprecation/security warning using the node library and reading js docs suggests going with Buffer.from is the way to go.

Emill commented 5 years ago

Hi. Do you know a way to make it backwards-compatible? Node v4.2 doesn't support Buffer.from.

ghost commented 5 years ago

Good question - I made an edit and have tested with node v4.2.0 and node v10.16.0 and it seemed to work. Got the idea from https://stackoverflow.com/questions/42110902/choose-between-new-bufferstr-and-buffer-fromstr