
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
express-gone
Advanced tools
Simple express middleware for displaying GONE (410) status code
This is a Node.js module available through the
npm registry. Installation is done using the
npm install command:
$ npm install express-gone --save
app.use("/somefile", require("express-gone")());
let gone = require("express-gone");
app.use("/somefile", gone());
Optional argument for changing default response.
The status code to send in the response. res.status(status); api
default is 410.
The redirect location to send in the response. res.redirect(status, redirect); api
default is undefined.
note: If redirect is used; type, render or message is ignored.
note: Most clients (browsers) do not play nicely with redirect when status code is not 3xx. It is recommended to use render or message instead of redirect.
The content type of the response. res.type(type); api
default is "text"
The name of the view for the response to render. res.render(render); api
default is undefined.
note: If render is used, message is ignored.
The variables to pass to the render view. res.render(render, renderLocals); api
default is undefined.
The content body of the response. res.send(send); api
default is "Gone!".
In express paths can be a single path string or express path pattern or regular expression or array with any of the previous types
For more information on paths see path-examples
// Status Code: 410, Content-Type: "text/plain"
// body: "Gone"
app.use(paths, gone());
// Status Code: 410, Content-Type: "text/html" (default for express is text/html)
// body: [what ever your render view looks like, with possibly the title "File Removed"]
app.use(paths, gone({ render: "error/gone", renderLocals: { title: "File Removed" } }));
// Status Code: 410, Content-Type: "text/plain"
// body: "File has gone, not even a ghost exists"
app.use(paths, gone({ type: "text", send: "File has gone, not even a ghost exists" }));
// Status Code: 301, Location: "/no-file"
app.use(paths, gone({ status: 301, redirect: "/no-file" }));
FAQs
Send Status Code 410 for a single or list of paths.
We found that express-gone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.