1.0.15 • Published 6 years ago

kresdl-index v1.0.15

Weekly downloads
1
License
MIT
Repository
github
Last release
6 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

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago