Skip to content

Commit

Permalink
Generate README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Nov 10, 2021
1 parent 209fe3e commit e74f40f
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 269 deletions.
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ module.exports = function (grunt)
},

documentation: {
cmd: 'npx documentation build -f html -o docs docs.js'
cmd: [
'npx documentation build -f html -o docs docs.js',
'asciidoc -b docbook -o - README.adoc | pandoc -f docbook -t gfm -o README.md'
].join('&&')
},
}
})
Expand Down
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
This is a Node.js module for calling
[`getdents64`](https://linux.die.net/man/2/getdents64) on Linux from
Javascript.

You might want to use this instead of `fs.readdir` if [you have a
directory containing many
files](http://be-n.com/spw/you-can-list-a-million-files-in-a-directory-but-not-with-ls.html).

API documentation is available
[here](http://rawgit.davedoesdev.com/davedoesdev/getdents/master/docs/index.html).

# Example

List regular files in `/tmp`:

``` javascript
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);
}
}
});
```

# Install

``` bash
npm install getdents
```

# Licence

[MIT](LICENCE)

# Test

``` bash
grunt test
```

# Coverage

``` bash
grunt coverage
```

LCOV results are available
[here](http://rawgit.davedoesdev.com/davedoesdev/getdents/master/coverage/lcov-report/index.html).

Coveralls page is [here](https://coveralls.io/r/davedoesdev/getdents).
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset='utf-8'>
<title>getdents 2.0.8 | Documentation</title>
<title>getdents 2.0.10 | Documentation</title>
<meta name='description' content='Call getdents(2) from Javscript'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet'>
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>getdents</h3>
<div class='mb1'><code>2.0.8</code></div>
<div class='mb1'><code>2.0.10</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down

0 comments on commit e74f40f

Please sign in to comment.