Skip to content

Commit

Permalink
Correct to node api v16+
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Oct 23, 2023
1 parent 47f016c commit a322a51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm install -g nw-gyp prebuildify node-gyp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm ls
Expand Down
16 changes: 8 additions & 8 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void ListProcessPID(const Nan::FunctionCallbackInfo<v8::Value>& info) {
if( Process32First(h, &pe)) {
do {
if (pe.th32ParentProcessID == pid)
children->Set(i++, Nan::New( (int) pe.th32ProcessID) );
Nan::Set(children, i++, Nan::New( (int) pe.th32ProcessID) );
} while( Process32Next(h, &pe));
}

Expand Down Expand Up @@ -176,13 +176,13 @@ void GetUTCTime(const Nan::FunctionCallbackInfo<v8::Value>& info)
v8::Local<v8::Array> ret_time = Nan::New<v8::Array>();

GetSystemTime(&system_time);
ret_time->Set(0, Nan::New((unsigned int) system_time.wYear));
ret_time->Set(1, Nan::New((unsigned int) system_time.wMonth - 1));
ret_time->Set(2, Nan::New((unsigned int) system_time.wDay));
ret_time->Set(3, Nan::New((unsigned int) system_time.wHour));
ret_time->Set(4, Nan::New((unsigned int) system_time.wMinute));
ret_time->Set(5, Nan::New((unsigned int) system_time.wSecond));
ret_time->Set(6, Nan::New((unsigned int) system_time.wMilliseconds));
Nan::Set(ret_time, 0, Nan::New((unsigned int) system_time.wYear));
Nan::Set(ret_time, 1, Nan::New((unsigned int) system_time.wMonth - 1));
Nan::Set(ret_time, 2, Nan::New((unsigned int) system_time.wDay));
Nan::Set(ret_time, 3, Nan::New((unsigned int) system_time.wHour));
Nan::Set(ret_time, 4, Nan::New((unsigned int) system_time.wMinute));
Nan::Set(ret_time, 5, Nan::New((unsigned int) system_time.wSecond));
Nan::Set(ret_time, 6, Nan::New((unsigned int) system_time.wMilliseconds));
info.GetReturnValue().Set(ret_time);
}

Expand Down

0 comments on commit a322a51

Please sign in to comment.