1.0.0 • Published 12 months ago

fadvise v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Native Node.js bindings for the posix_fadvise() function on Linux

Usage:

const fadvise = require('fadvise');
const fs = require('fs');

let fd = fs.openSync('./test.tmp', 'a');
fs.writeSync(fd, 'hundreds of megabytes');
fs.fsync(fd, function () {
  fadvise.posix_fadvise(fd, 0, 0, fadvise.POSIX_FADV_DONTNEED);
  fs.closeSync(fd);
});

In the example above, top and nocache's cachestats test.tmp should indicate 0 (additional) pages in buffers/cache.

See posix_fadvise(7) for details.

1.0.0

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago