{"_id":"@azure/functions-extensions-express","_rev":"2-3a7f0f66c8491fff8498b0c070c65fff","name":"@azure/functions-extensions-express","dist-tags":{"preview":"0.1.0-preview","latest":"0.1.1-preview"},"versions":{"0.1.0-preview":{"name":"@azure/functions-extensions-express","version":"0.1.0-preview","keywords":["azure","functions","serverless","express","nodejs"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/functions-extensions-express@0.1.0-preview","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"homepage":"https://github.com/Azure/azure-functions-nodejs-library#readme","bugs":{"url":"https://github.com/Azure/azure-functions-nodejs-library/issues"},"tag":"preview","dist":{"shasum":"04c5be88bef242fb20f61fabe25feaa1848349b9","tarball":"https://registry.npmjs.org/@azure/functions-extensions-express/-/functions-extensions-express-0.1.0-preview.tgz","fileCount":3105,"integrity":"sha512-PYds0IJQ57t3VgsO4V3o9LrFte/vYfhDTqyeOJU3GFYV/OAl0pXADTYwrBd/h8F8MjxbhnwHGb6SDdNM/iWf8w==","signatures":[{"sig":"MEQCIEYqSe/tkJdv/HWc7faRYbWY7Ox9fvW5e84fbFK1oN0iAiA0lsLSFHlkCgTPsxxXKLtNEepnAhA+OXkBIoiRVoQrRQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49840605},"main":"dist/index.js","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\8f2be22c-2863-4835-af0f-70c9685e0893\\azure-functions-extensions-express-0.1.0-preview.tgz","types":"types/index.d.ts","engines":{"node":">=18.0"},"scripts":{"lint":"eslint src/**/*.ts","test":"mocha --require ts-node/register test/**/*.test.ts","build":"tsc","watch":"tsc -w"},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\8f2be22c-2863-4835-af0f-70c9685e0893\\azure-functions-extensions-express-0.1.0-preview.tgz","_integrity":"sha512-PYds0IJQ57t3VgsO4V3o9LrFte/vYfhDTqyeOJU3GFYV/OAl0pXADTYwrBd/h8F8MjxbhnwHGb6SDdNM/iWf8w==","repository":{"url":"git+https://github.com/Azure/azure-functions-nodejs-library.git","type":"git","directory":"extensions/functions-extensions-express"},"description":"Express integration for Azure Functions - run Express apps natively in Azure Functions","directories":{},"_nodeVersion":"18.5.0","dependencies":{"typescript":"^5.0.0","@types/node":"^18.0.0","@azure/functions":"^4.11.0"},"_hasShrinkwrap":false,"peerDependencies":{"@azure/functions":"^4.11.0"},"_npmOperationalInternal":{"tmp":"tmp/functions-extensions-express_0.1.0-preview_1773993828298_0.6605892602906691","host":"s3://npm-registry-packages-npm-production"}},"0.1.1-preview":{"name":"@azure/functions-extensions-express","version":"0.1.1-preview","description":"Express integration for Azure Functions - run Express apps natively in Azure Functions","main":"dist/index.js","types":"types/index.d.ts","license":"MIT","author":{"name":"Microsoft Corporation"},"homepage":"https://github.com/Azure/azure-functions-nodejs-extensions-express#readme","repository":{"type":"git","url":"git+https://github.com/Azure/azure-functions-nodejs-extensions.git","directory":"/azure-functions-nodejs-extensions-express"},"keywords":["azure","functions","serverless","express","nodejs"],"scripts":{"build":"tsc","watch":"tsc -w","lint":"eslint src/**/*.ts","test":"mocha --require ts-node/register test/**/*.test.ts"},"engines":{"node":">=18.0"},"dependencies":{"@azure/functions":"^4.11.0","@types/node":"^18.0.0","typescript":"^5.0.0"},"peerDependencies":{"@azure/functions":"^4.11.0"},"bugs":{"url":"https://github.com/Azure/azure-functions-nodejs-extensions/issues"},"_id":"@azure/functions-extensions-express@0.1.1-preview","_integrity":"sha512-/EiEQTFan/WhDn8LWN344u9DBN72Mv5MLoD9Zl0kTXi1cEjU21invoGBd+lLHnsFS/dcB0VtOikpuCm88wDyZg==","_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\6d83ee54-c0bf-4a00-afa0-f48d39b5f8f2\\azure-functions-extensions-express-0.1.1-preview.tgz","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App2\\temp\\6d83ee54-c0bf-4a00-afa0-f48d39b5f8f2\\azure-functions-extensions-express-0.1.1-preview.tgz","tag":"latest","_nodeVersion":"18.5.0","dist":{"integrity":"sha512-/EiEQTFan/WhDn8LWN344u9DBN72Mv5MLoD9Zl0kTXi1cEjU21invoGBd+lLHnsFS/dcB0VtOikpuCm88wDyZg==","shasum":"4cc6b85423026a160fbca49599d0154c2fc5ecdc","tarball":"https://registry.npmjs.org/@azure/functions-extensions-express/-/functions-extensions-express-0.1.1-preview.tgz","fileCount":3107,"unpackedSize":100522601,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICg2oK7dY4rZX41nt1i+rmu/SNftXhvcWY72MbtbdGcZAiEAm5cYg0KUrYFI8VoC/gXu3MFBQ9KpwIb8jAwsF/eR7Kw="}]},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"directories":{},"maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/functions-extensions-express_0.1.1-preview_1774383066008_0.7033472482858623"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-20T08:03:48.090Z","modified":"2026-03-24T20:11:08.037Z","0.1.0-preview":"2026-03-20T08:03:48.865Z","0.1.1-preview":"2026-03-24T20:11:07.896Z"},"bugs":{"url":"https://github.com/Azure/azure-functions-nodejs-extensions/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-functions-nodejs-extensions-express#readme","keywords":["azure","functions","serverless","express","nodejs"],"repository":{"type":"git","url":"git+https://github.com/Azure/azure-functions-nodejs-extensions.git","directory":"/azure-functions-nodejs-extensions-express"},"description":"Express integration for Azure Functions - run Express apps natively in Azure Functions","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"readme":"# @azure/functions-extensions-express\r\n\r\nExpress integration for Azure Functions - run Express apps natively within Azure Functions with full middleware and streaming support.\r\n\r\n## Features\r\n\r\n- **Native Express** - Express runs as a real HTTP server, not an adapter\r\n- **Full Middleware Support** - All Express middleware works without modification\r\n- **Streaming** - Server-Sent Events and large responses stream natively\r\n- **Zero Code Changes** - Use your existing Express app as-is\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @azure/functions-extensions-express express\r\n```\r\n\r\n## Quick Start\r\n\r\n```typescript\r\nimport express from 'express';\r\nimport { expressApp } from '@azure/functions-extensions-express';\r\n\r\n// Create your Express app\r\nconst app = express();\r\n\r\napp.get('/health', (req, res) => {\r\n    res.json({ status: 'ok' });\r\n});\r\n\r\napp.get('/users', (req, res) => {\r\n    res.json([\r\n        { id: 1, name: 'Alice' },\r\n        { id: 2, name: 'Bob' }\r\n    ]);\r\n});\r\n\r\n// Register with Azure Functions\r\nexpressApp('api', app, {\r\n    route: 'api/{*path}',\r\n    basePath: '/api'\r\n});\r\n```\r\n\r\n## Streaming Example (Server-Sent Events)\r\n\r\n```typescript\r\nimport express from 'express';\r\nimport { expressApp } from '@azure/functions-extensions-express';\r\n\r\nconst app = express();\r\n\r\napp.get('/stream', (req, res) => {\r\n    res.setHeader('Content-Type', 'text/event-stream');\r\n    res.setHeader('Cache-Control', 'no-cache');\r\n    res.setHeader('Connection', 'keep-alive');\r\n\r\n    let count = 0;\r\n    const interval = setInterval(() => {\r\n        res.write(`data: ${JSON.stringify({ event: ++count })}\\n\\n`);\r\n        if (count >= 10) {\r\n            clearInterval(interval);\r\n            res.end();\r\n        }\r\n    }, 1000);\r\n});\r\n\r\nexpressApp('api', app, {\r\n    route: 'api/{*path}',\r\n    basePath: '/api',\r\n    enableStreaming: true\r\n});\r\n```\r\n\r\n## API Reference\r\n\r\n### `expressApp(name, app, options?)`\r\n\r\nRegisters an Express application as an Azure Function.\r\n\r\n**Parameters:**\r\n- `name` - Function name (string)\r\n- `app` - Express application\r\n- `options` - Configuration options (optional)\r\n\r\n**Options:**\r\n| Option | Type | Default | Description |\r\n|--------|------|---------|-------------|\r\n| `route` | string | `'{*path}'` | Azure Functions route pattern |\r\n| `basePath` | string | `''` | Path prefix to strip before routing to Express |\r\n| `methods` | string[] | All methods | HTTP methods to accept |\r\n| `authLevel` | string | `'anonymous'` | Azure Functions auth level |\r\n| `enableStreaming` | boolean | `true` | Enable streaming responses |\r\n| `timeout` | number | `30000` | Request timeout (ms) |\r\n| `port` | number | `0` | Express server port (0 = auto) |\r\n\r\n**Returns:** `ExpressServer` - Server instance for lifecycle management\r\n\r\n### `stopAllServers()`\r\n\r\nStops all Express servers. Use during app termination.\r\n\r\n```typescript\r\nimport { app } from '@azure/functions';\r\nimport { stopAllServers } from '@azure/functions-extensions-express';\r\n\r\napp.hook.appTerminate(async () => {\r\n    await stopAllServers();\r\n});\r\n```\r\n\r\n### `getServer(name)`\r\n\r\nGets an Express server by function name.\r\n\r\n```typescript\r\nimport { getServer } from '@azure/functions-extensions-express';\r\n\r\nconst server = getServer('api');\r\nconsole.log(`Server running on port ${server?.port}`);\r\n```\r\n\r\n## How It Works\r\n\r\nThis extension runs Express as a real HTTP server on localhost within the Azure Functions worker process. When an HTTP request arrives at Azure Functions:\r\n\r\n1. The request is proxied to the Express server\r\n2. Express handles it with full middleware support\r\n3. The response is streamed back to the client\r\n\r\nThis architecture provides true Express compatibility without adaptation layers.\r\n\r\n## Requirements\r\n\r\n- Node.js 18+\r\n- @azure/functions ^4.0.0\r\n- Express ^4.0.0 or ^5.0.0\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}