Socket
Book a DemoInstallSign in
Socket

cgi-express

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cgi-express

Executes Express.js application as a CGI program

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

cgi-express

NPM version Build Status

[EXPERIMENTAL; Not tested well] Executes Express.js application as CGI program.

  • Since this library is not tested well, please be HIGHLY CAREFUL with using this in production.
  • This library may be uncompatible with some CGI executors.

Requirements

  • Express.js (tested with 4.x)
    • For TypeScript, @types/express is necessary to build
  • Node.js >=10

Example

#!/usr/bin/env node
const express = require('express');
const cgiExpress = require('cgi-express');

const app = express();
// initialize 'app' as usual Express.js application here...

// call 'execute' with the default configuration
// (using process.stdout, process.stdin, and process.env)
cgiExpress.execute(app);

API

function execute(app: express.Application, opts?: Options): Promise<void>

Executes Express.js application as a CGI program. This function uses process.stdin, process.stdout, and process.env properties as default.

Parameters

  • app -- An Express.js application instance
  • opts -- Additional options (Options) for execution

Returns

Promise object which resolves when execution finishes

function executeCore(app: express.Application, opts?: Options & Required<Pick<Options, 'stdin' | 'stdout' | 'env'>>): Promise<void>

Executes Express.js application as a CGI program, with custom stdin/stdout/env data.

Parameters

  • app -- An Express.js application instance
  • opts -- Additional options (Options) for execution (stdin/stdout/env are not omittable)

Returns

Promise object which resolves when execution finishes

License

MIT License

Keywords

express

FAQs

Package last updated on 04 Feb 2023

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