1.0.15 • Published 7 years ago

kresdl-index v1.0.15

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

kresdl-index

npm npm

Creates directory serving middleware for use with Express.

Install

npm install kresdl-index

Usage examples

Serve HTML formatted index

index accepts a root path and returns a middleware that serves directory listing by appending request.path to the root path.

const { index } = require('kresdl-index');
const app = require('express')();

app.use('/', index('path/to/static/files'));
Get file list from directory path

dir accepts a path and returns a promise which resolves to an array of filenames.

const { dir } = require('kresdl-index');

const files = await dir('directory/to/be/listed'));
...

License

MIT © Peter Hallström

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago