Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/serve-static

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/serve-static

TypeScript definitions for serve-static

  • 1.15.7
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24M
increased by7.41%
Maintainers
1
Weekly downloads
 
Created

What is @types/serve-static?

The @types/serve-static package contains TypeScript type definitions for the serve-static middleware, which is used with Node.js HTTP servers to serve static files. These type definitions allow TypeScript developers to use serve-static in a type-safe manner, ensuring that they use the correct types for function arguments, return types, and object properties.

What are @types/serve-static's main functionalities?

Serve static files

This code sample demonstrates how to use serve-static with Express to serve static files from the 'public' directory. It also specifies that 'index.html' or 'index.htm' should be used as the default file to serve if a directory is requested.

import * as express from 'express';
import * as serveStatic from 'serve-static';

const app = express();

app.use(serveStatic('public', {'index': ['index.html', 'index.htm']}));

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Other packages similar to @types/serve-static

FAQs

Package last updated on 03 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc