New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

koa-index

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-index

Serve directory listings for Koa

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
6
50%
Maintainers
1
Weekly downloads
 
Created
Source

koa-index

Commitizen friendly

Serve directory listings for Koa

Install

NPM

Screenshot

screenshot

Usage

import Koa from 'koa'
import path from 'path'
import koaIndex from 'koa-index'

const app = new Koa()

app.use(
  koaIndex(__dirname, {
    hidden: true
  })
)

app.listen(8080)

API

interface IOpts {
  index?: string | boolean
  directory?: boolean
  maxAge?: number
  lastModified?: boolean
  etag?: boolean
  hidden?: boolean
}

koaIndex(root: string, opts?: IOpts)

Options

  • index: Default file name, defaults to index.html
  • directory: Support directory send, defaults to true
  • maxAge: cache control max age (in milliseconds) for the files, default to 0
  • lastModified: Enable or disable Last-Modified header, defaults to true
  • etag: Enable or disable etag generation, defaults to true
  • hidden: Display hidden (dot) files. Defaults to false

License

MIT

Keywords

koa

FAQs

Package last updated on 22 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts