valeriansaliou / node-fast-ratelimit

:umbrella: Fast and efficient in-memory rate-limit for Node, used to alleviate most common DOS attacks.
https://www.npmjs.com/package/fast-ratelimit
MIT License
107 stars 18 forks source link

Several compile warnings #10

Closed kokujin closed 2 years ago

kokujin commented 5 years ago

node-fast-ratelimit emits sevral errors when being compiled, for example:

../node_modules/nan/nan_implementation_12_inl.h:340:28: warning: 'New' is deprecated [-Wdeprecated-declarations] return v8::StringObject::New(value).As<v8::StringObject>();

../node_modules/nan/nan.h:1066:44: warning: 'ToString' is deprecated [-Wdeprecated-declarations] v8::Local<v8::String> string = from->ToString();

../node_modules/nan/nan.h:1080:27: warning: 'WriteUtf8' is deprecated [-Wdeprecated-declarations] length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);

9 warnings generated. SOLINK_MODULE(target) Release/native.node

Maybe its time that @valeriansaliou had a chat with the maintainer of the hashtable module?

valeriansaliou commented 5 years ago

Can you provide more details on the platform you're getting those warnings on?

kokujin commented 5 years ago

These warnings are emitted when installing the rate limiter hook for the feathers.js framework. The hook uses node-fast-ratelimit as a dependency feathers-hooks-ratelimit

valeriansaliou commented 5 years ago

What's your OS, what's your compiler? (GCC? Which version?)

kokujin commented 5 years ago

I am using an Apple device, OSX 10.13.6, the compiler is Xcode 10.1, Build version 10B61. I presume. The warnings are also emitted on my colleagues Windows device.

valeriansaliou commented 5 years ago

Gotcha, I'll have a look when I have time :)

kokujin commented 5 years ago

Great! Thanks

valeriansaliou commented 2 years ago

Hello there! I've fixed that in v3.0.0, using the JS-native Map object, which has as well be measured in my tests to be faster anyway. This new version does not compile any dependencies anymore, fixing this issue.