diff --git a/binding/nodejs/index.js b/binding/nodejs/index.js index 0ed4896d53f26af6a939755f1606c28e40bd9fd5..87d027568260cf291b955069786474d389704cb0 100644 --- a/binding/nodejs/index.js +++ b/binding/nodejs/index.js @@ -122,7 +122,7 @@ class Searcher { } } if (fd) { - fs.close(fd) + fs.close(fd,function(){}) } const diff = process.hrtime(startTime) @@ -178,7 +178,7 @@ const loadVectorIndexFromFile = dbPath => { const fd = fs.openSync(dbPath, 'r') const buffer = Buffer.alloc(VectorIndexLength) fs.readSync(fd, buffer, 0, VectorIndexLength, 256) - fs.close(fd) + fs.close(fd,function(){}) return buffer } @@ -187,7 +187,7 @@ const loadContentFromFile = dbPath => { const buffer = Buffer.alloc(stats.size) const fd = fs.openSync(dbPath, 'r') fs.readSync(fd, buffer, 0, stats.size, 0) - fs.close(fd) + fs.close(fd,function(){}) return buffer }