Registry / http-networking / ienoopen

ienoopen

JSON →
library1.1.1jsnpmunverified

ienoopen is an Express-compatible middleware designed to enhance client-side security by setting the `X-Download-Options` HTTP header to `noopen`. This header, primarily relevant for Internet Explorer 8 and later, prevents users from directly opening downloaded HTML files in the browser's context, thereby mitigating certain types of HTML injection and cross-site scripting (XSS) attacks by forcing a "Save" action instead. The package is currently at version 1.1.1, with its last update over six years ago. It is considered to be in maintenance mode, as its standalone GitHub repository is archived, and its functionality has been integrated into the comprehensive `Helmet` security middleware suite, which includes `ienoopen` by default as `helmet.ieNoOpen()`. This package's narrow focus on a single, legacy IE-specific security header is its key differentiator, although its practical relevance has significantly diminished with modern browser adoption.

npm install ienoopen
INSTALL
IMPORT
SIG · IENOOPEN
I
ienoopen
http-networkingjavascriptv1.1.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ienoopen
✓ import ienoopen from 'ienoopen';
✗ import { ienoopen } from 'ienoopen';
The package exports a default function. Do not use named imports.
ienoopen
✓ const ienoopen = require('ienoopen');
CommonJS `require` syntax as shown in the original README.
ienoopen.d.ts
✓ import type { RequestHandler } from 'express';
The `ienoopen` package ships its own types, but the middleware function itself aligns with Express's `RequestHandler`. No specific types are exported by `ienoopen` beyond its default function.

Sets up an Express server and applies the `ienoopen` middleware to set the `X-Download-Options` header. It also includes an example route that serves a downloadable HTML file to demonstrate the header's purpose in preventing direct execution in IE.

import express from 'express'; import ienoopen from 'ienoopen'; const app = express(); const port = 3000; // Apply the ienoopen middleware // This sets the 'X-Download-Options: noopen' header app.use(ienoopen()); app.get('/', (req, res) => { res.send('Hello World! X-Download-Options header set.'); }); app.get('/download-unsafe-html', (req, res) => { res.setHeader('Content-Type', 'text/html'); res.setHeader('Content-Disposition', 'attachment; filename="malicious.html"'); // In older IE, without X-Download-Options: noopen, this could be opened directly. res.send('<html><body onload="alert(\'Malicious script executed in site context!\')"><h1>Untrusted content</h1></body></html>'); }); app.listen(port, () => { console.log(`Server listening at http://localhost:${port}`); console.log('Check response headers for X-Download-Options: noopen on relevant routes.'); });
Debug
Known issues
deprecatedThe `X-Download-Options` header, which this package sets, is an unofficial header primarily implemented by Internet Explorer 8+. Modern browsers like Chrome, Firefox, and Safari do not support this header, making its security benefits largely irrelevant for contemporary web development.
fix
For broader security, consider using a comprehensive security middleware like Helmet, which includes this functionality (as `helmet.ieNoOpen()`) along with other critical headers for modern browsers.
affects: >=1.0.0
gotchaThe standalone `ienoopen` package is no longer actively maintained, and its GitHub repository is archived. While functional, no further updates or bug fixes are expected for this standalone module.
fix
Prefer using the `Helmet` middleware suite (`app.use(helmet())` or `app.use(helmet.ieNoOpen())`) if you still require this specific header alongside other modern security protections.
affects: >=1.0.0
gotchaThe `X-` prefix for HTTP headers (e.g., `X-Download-Options`) has been deprecated. While still understood by older systems, new headers should avoid this convention.
fix
No direct fix within this package, as it's designed to set a specific, legacy header. Be aware that this header pattern is outdated.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: ienoopen is not a function
Attempting to use `app.use(ienoopen)` instead of invoking the middleware function `app.use(ienoopen())`.
fix
Ensure you call `ienoopen()` to get the middleware function: `app.use(ienoopen());`
Error: Cannot find module 'ienoopen'
The package `ienoopen` has not been installed or there's a typo in the import/require path.
fix
Install the package using npm: `npm install ienoopen` or yarn: `yarn add ienoopen`. Double-check the import/require statement for typos.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
expressrequiredRuntime dependency for Express.js application middleware integration.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
ienoopen — npm install ienoopen · libregistry