Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
{
"targets": [{
"target_name": "epoll",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "10.7",
},
"msvs_settings": {
"VCCLCompilerTool": { "ExceptionHandling": 1 },
},
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "10.7",
},
"msvs_settings": {
"VCCLCompilerTool": { "ExceptionHandling": 1 },
},
"conditions": [[
'OS == "linux"', {
"include_dirs" : [
"<!(node -e \"require('nan')\")"
'dependencies': [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
],
"sources": [
"./src/epoll.cc"
"./src/epoll.cc",
"./src/watcher.cc"
],
"conditions": [[
'"<!(echo $V)" != "1"', {
Expand Down
28 changes: 28 additions & 0 deletions epoll.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export class Epoll {
constructor(
callback: (
err: Error | null,
fs: number | undefined,
events: number | undefined
) => void
);

get closed(): boolean;

add(fd: number, events: number): Epoll;
close(): void;
remove(fd: number): Epoll;
modify(fd: number, events: number): Epoll;

static EPOLLIN: number;
static EPOLLOUT: number;
static EPOLLRDHUP: number;
static EPOLLPRI: number;
static EPOLLERR: number;
static EPOLLHUP: number;
static EPOLLET: number;
static EPOLLONESHOT: number;
}

// TODO - should it export as possibly null?
// export const Epoll: EpollClass | null;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "epoll",
"version": "4.0.2",
"version": "5.0.0-0",
"description": "A low-level Node.js binding for the Linux epoll API",
"main": "epoll.js",
"directories": {
Expand All @@ -17,11 +17,11 @@
"url": "https://github.com/fivdi/epoll.git"
},
"engines": {
"node": ">=10.0.0"
"node": ">=18.0"
},
"dependencies": {
"bindings": "^1.5.0",
"nan": "^2.17.0"
"node-addon-api": "^7.1.0"
},
"devDependencies": {
"jshint": "^2.13.6"
Expand Down
Loading