This commit is contained in:
Andrew Gundersen 2021-08-13 14:55:14 -05:00
commit d32989cc81
135 changed files with 17183 additions and 669 deletions

24
node_modules/sleep/module_init.cc generated vendored Normal file
View file

@ -0,0 +1,24 @@
#include "sleep.h"
using v8::FunctionTemplate;
using v8::String;
NAN_METHOD(MUSleep) {
Nan::HandleScope scope;
if (info.Length() < 1 || !info[0]->IsUint32()) {
Nan::ThrowError("Expected number of microseconds");
return;
}
node_usleep(Nan::To<uint32_t>(info[0]).FromJust());
info.GetReturnValue().SetUndefined();
}
NAN_MODULE_INIT(init) {
Nan::Set(target, Nan::New<String>("usleep").ToLocalChecked(),
Nan::GetFunction(Nan::New<FunctionTemplate>(MUSleep)).ToLocalChecked());
}
NODE_MODULE(node_sleep, init)