diff --git a/README.md b/README.md index 5db3793..5d72f56 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ fs-ext [![Coverage Status][cov-img]][cov-url] [![Windows Status][ci-win-img]][ci-win-url] -Extras not included in Node's fs module. +Extras not included in Node's fs module. Supports Node 0.10 upwards. **Note**: diff --git a/fs-ext.cc b/fs-ext.cc index 53a8a54..3474772 100644 --- a/fs-ext.cc +++ b/fs-ext.cc @@ -344,8 +344,8 @@ static NAN_METHOD(Flock) { store_data_t* flock_data = new store_data_t(); flock_data->fs_op = FS_OP_FLOCK; - flock_data->fd = info[0].As()->Value(); - flock_data->oper = info[1].As()->Value(); + flock_data->fd = Nan::To(info[0]).FromJust(); + flock_data->oper = Nan::To(info[1]).FromJust(); if (info[2]->IsFunction()) { flock_data->cb = new Nan::Callback((Local) info[2].As()); @@ -395,10 +395,10 @@ static NAN_METHOD(Seek) { return THROW_BAD_ARGS; } - int fd = info[0].As()->Value(); + int fd = Nan::To(info[0]).FromJust(); ASSERT_OFFSET(info[1]); off_t offs = GET_OFFSET(info[1]); - int whence = info[2].As()->Value(); + int whence = Nan::To(info[2]).FromJust(); if ( ! info[3]->IsFunction()) { #ifdef _WIN32 @@ -437,9 +437,9 @@ static NAN_METHOD(Fcntl) { return THROW_BAD_ARGS; } - int fd = info[0].As()->Value(); - int cmd = info[1].As()->Value(); - int arg = info[2].As()->Value(); + int fd = Nan::To(info[0]).FromJust(); + int cmd = Nan::To(info[1]).FromJust(); + int arg = Nan::To(info[2]).FromJust(); if ( ! info[3]->IsFunction()) { int result = fcntl(fd, cmd, arg); diff --git a/package-lock.json b/package-lock.json index 6fdb85e..c43da20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "fs-ext", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 466f9cd..8b9d81d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "flock", "seek" ], - "version": "2.0.1", + "version": "2.0.2", "homepage": "https://github.com/baudehlo/node-fs-ext/", "repository": { "type": "git", @@ -16,7 +16,7 @@ }, "main": "fs-ext.js", "engines": { - "node": ">= 8.0.0" + "node": ">= 0.10" }, "dependencies": { "nan": "^2.14.0"