
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Standard HTTP interfaces for HTTP clients and servers in node.js and browsers
Standard, framework-agnostic HTTP interfaces for JavaScript servers and clients.
npm install servie --save
throwback
Compose middleware functions into a single functionpopsicle
HTTP request library for node.js and browsersservie-lambda
Servie transport layer for AWS Lambdaservie-http
Servie transport layer for node.js HTTPget-body
General body parser for forms, JSON and textservie-cors
CORS middleware for Servieservie-route
Routing middleware for Servieservie-mount
Mount Servie middleware on a path prefixservie-compat-http
Mimic node.js HTTP using Servieservie-redirect
Create response objects for redirectionservie-cookie-store
API for managing client-side cookiesservie-errorhandler
Standard error handler for transport layersservie-finalhandler
Standard final handler for transport layershttp-errors
Create HTTP errorsboom
HTTP-friendly error objectsconsolidate
Template renderingimport { Body, Request, Response, Headers, AbortController } from "servie";
Servie is a universal package, meaning node.js and browsers are supported without needing configuration. This means the primary endpoint requires some
dom
types in TypeScript. When in a node.js, or browser, only environment, prefer importingservie/dist/{node,browser}
instead.
Body
Base HTTP class shared between
Request
andResponse
.
new Body(body, headers);
Supported body types, depending on environment:
string | Buffer | ArrayBuffer | Readable | null | undefined
string | ArrayBuffer | ReadableStream | null | undefined
bodyUsed
Boolean whether the body is already consumedtext()
Returns the body as a Promise<string>
json()
Returns the body with JSON.parse
as Promise<any>
arrayBuffer()
Returns the body as a Promise<ArrayBuffer>
clone()
Clones an unconsumed bodydestroy()
Consumes and destroys the bodyRequest
HTTP class for modelling a
Request
, extendsBody
.
new Request(input [, init]);
A URL string or another Request
instance to clone from.
method?
HTTP request method.body?
Any support body types.signal?
A signal from an AbortController
.headers?
A map, list of tuples, or Header
instance to initialize from.trailer?
A promise resolve to a support header initialization types (above).url
Requested url stringmethod
Requested method stringsignal
Signal event emitterheaders
A Headers
instancetrailer
A Promise<Headers>
instanceclone()
Clones the request into a new instanceResponse
HTTP class for modelling a
Response
, extendsBody
.
new Response([body [, init]]);
One of the support body types (above).
status?
The numeric HTTP response status codestatusText?
The HTTP response status textstatus
The numeric HTTP response status codestatusText
The HTTP response status textok
Boolean indicates successful response (status
between 200 and 299)headers
A Headers
instancetrailer
A Promise<Headers>
instanceclone()
Clones the response into a new instanceHeaders
Map representation of HTTP headers.
new Headers([init]);
Initialize headers from Iterable<HeaderTuple>
, a HeadersObject
or an existing Headers
instance.
set(name: string, value: string | string[]): void
Set a HTTP header by overriding case-insensitive headers of the same nameappend(name: string, value: string | string[]): void
Append a HTTP headerget(name: string): string | undefined
Retrieve a case-insensitive HTTP headergetAll(name: string): string[]
Retrieve a list of matching case-insensitive HTTP headershas(name: string): boolean
Check if a case-insensitive header is already setdelete(name: string): void
Delete a case-insensitive headerasObject(): HeadersObject
Return the lower-cased headers as a plain objectextend(obj: HeadersInit): this
Extends the current headers with an objectkeys()
Iterable of the available header namesvalues()
Iterable of header valuesentries()
Iterable of headers as [key, value]
clear()
Clears the headers instanceclone()
Clones the Headers
instanceAbortController
Simple controller for aborting a
Request
instance.
new AbortController();
signal
A Signal
instance to pass to a Request
abort()
Used to abort any listening requests through the signal
Signal
Tiny event emitter for communicating during a request.
aborted
Boolean indicating whether the request is abortedon(type, fn)
Attach an event listener to an event typeoff(type, fn)
Remove an event listener from an event typeeach(fn)
Attach an event listener for all eventsnone(fn)
Remove a global event listeneremit(type, ...args)
Emit an event to all listenersabort
The request has been abortedrequestBytes
Emitted on request progress with current bytesrequestEnded
The request has endedrequestStarted
The request has been startedresponseBytes
Emitted on response progress with current bytesresponseEnded
The response has endedresponseStarted
The response has startedPlugins can emit new types of events.
If you're building the transports for Servie, there are some life cycle events you need to be aware of:
error
event on signal
for errorsabort
event on signal
to destroy the connectiontrailer
promise and append to HTTP request or responseSignalEvents
you can supportThis module is designed for ES2017 environments and published with TypeScript definitions on NPM.
Apache 2.0
FAQs
Standard HTTP interfaces for HTTP clients and servers in node.js and browsers
The npm package servie receives a total of 90,366 weekly downloads. As such, servie popularity was classified as popular.
We found that servie 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 Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.