package
Call getdents(2) from Javscript
npm install getdentsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
This is a Node.js module for calling
getdents64 on Linux from
Javascript.
You might want to use this instead of fs.readdir if you have a
directory containing many
files.
API documentation is available here.
List regular files in /tmp:
const fs = require('fs'),
assert = require('assert'),
Getdents = require('getdents').Getdents;
fs.open('/tmp', 'r', async function (err, fd)
{
assert.ifError(err);
let getdents = new Getdents(1024 * 1024, fd);
for await (let _ of getdents)
{
if (getdents.type === Getdents.DT_REG)
{
console.log(getdents.name);
}
}
});npm install getdentsgrunt testgrunt coverageLCOV results are available here.
Coveralls page is here.
Estimated unpacked size across 4 packages.
2.2 MB
Includes dependencies.