
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
servie-send
Advanced tools
Create a HTTP response to send using Servie - a thin layer for creating a
Response
object with cache headers.
npm install servie-send --save
import {
sendText,
sendHtml,
sendJson,
sendStream,
sendEmpty,
entityTag
} from "servie-send";
function handle(req) {
return sendText(req, "hello world!");
return sendHtml(req, "<!doctype html>");
return sendJson(req, { json: true });
return sendStream(req, fs.createReadStream("example.txt"));
return sendEmpty(req); // Nothing in response.
}
status?
Change the default response status code (200).headers?
Define the headers to use for the response.contentType?
Define content length for the response.contentLength?
Define content length for the response.mtime?
Define the modification Date
for the response.etag?
Define an ETag for the response (e.g. pre-computed with entityTag()
or true
for on-demand).This project is written using TypeScript and publishes the definitions directly to NPM.
Apache 2.0
FAQs
Generate a HTTP response with client-side cache support
We found that servie-send 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.