npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@azure/functions-extensions-express

v0.1.1-preview

Published

Express integration for Azure Functions - run Express apps natively in Azure Functions

Readme

@azure/functions-extensions-express

Express integration for Azure Functions - run Express apps natively within Azure Functions with full middleware and streaming support.

Features

  • Native Express - Express runs as a real HTTP server, not an adapter
  • Full Middleware Support - All Express middleware works without modification
  • Streaming - Server-Sent Events and large responses stream natively
  • Zero Code Changes - Use your existing Express app as-is

Installation

npm install @azure/functions-extensions-express express

Quick Start

import express from 'express';
import { expressApp } from '@azure/functions-extensions-express';

// Create your Express app
const app = express();

app.get('/health', (req, res) => {
    res.json({ status: 'ok' });
});

app.get('/users', (req, res) => {
    res.json([
        { id: 1, name: 'Alice' },
        { id: 2, name: 'Bob' }
    ]);
});

// Register with Azure Functions
expressApp('api', app, {
    route: 'api/{*path}',
    basePath: '/api'
});

Streaming Example (Server-Sent Events)

import express from 'express';
import { expressApp } from '@azure/functions-extensions-express';

const app = express();

app.get('/stream', (req, res) => {
    res.setHeader('Content-Type', 'text/event-stream');
    res.setHeader('Cache-Control', 'no-cache');
    res.setHeader('Connection', 'keep-alive');

    let count = 0;
    const interval = setInterval(() => {
        res.write(`data: ${JSON.stringify({ event: ++count })}\n\n`);
        if (count >= 10) {
            clearInterval(interval);
            res.end();
        }
    }, 1000);
});

expressApp('api', app, {
    route: 'api/{*path}',
    basePath: '/api',
    enableStreaming: true
});

API Reference

expressApp(name, app, options?)

Registers an Express application as an Azure Function.

Parameters:

  • name - Function name (string)
  • app - Express application
  • options - Configuration options (optional)

Options: | Option | Type | Default | Description | |--------|------|---------|-------------| | route | string | '{*path}' | Azure Functions route pattern | | basePath | string | '' | Path prefix to strip before routing to Express | | methods | string[] | All methods | HTTP methods to accept | | authLevel | string | 'anonymous' | Azure Functions auth level | | enableStreaming | boolean | true | Enable streaming responses | | timeout | number | 30000 | Request timeout (ms) | | port | number | 0 | Express server port (0 = auto) |

Returns: ExpressServer - Server instance for lifecycle management

stopAllServers()

Stops all Express servers. Use during app termination.

import { app } from '@azure/functions';
import { stopAllServers } from '@azure/functions-extensions-express';

app.hook.appTerminate(async () => {
    await stopAllServers();
});

getServer(name)

Gets an Express server by function name.

import { getServer } from '@azure/functions-extensions-express';

const server = getServer('api');
console.log(`Server running on port ${server?.port}`);

How It Works

This extension runs Express as a real HTTP server on localhost within the Azure Functions worker process. When an HTTP request arrives at Azure Functions:

  1. The request is proxied to the Express server
  2. Express handles it with full middleware support
  3. The response is streamed back to the client

This architecture provides true Express compatibility without adaptation layers.

Requirements

  • Node.js 18+
  • @azure/functions ^4.0.0
  • Express ^4.0.0 or ^5.0.0

License

MIT