
Security News
crates.io Ships Security Tab and Tightens Publishing Controls
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.
http-codex
Advanced tools
A simple library for HTTP status codes and methods, adapted from Go's http package.
# Install using your favorite package manager:
npm install http-codex
pnpm add http-codex
bun add http-codex
yarn add http-codex
import { httpMethod, httpStatus } from 'http-codex'
const res = new Response('hello world!', {
status: httpStatus.OK, // 200
statusText: httpStatus.text(httpStatus.OK), // 'OK'
})
// HTTP methods
const method = httpMethod.GET // 'GET'
If preferred, status codes and methods can be imported by themselves to reduce bundle size:
import { httpMethod } from 'http-codex/method'
import { httpStatus } from 'http-codex/status'
const status = httpStatus.OK // 200
const method = httpMethod.POST // 'POST'
Helper function that returns whether the status should have a null body:
import { httpStatus, isNullBodyStatus } from 'http-codex'
const res = await fetch(url) // Might be 204, 304, etc.
return new Response(isNullBodyStatus(res.status) ? null : res.body, {
// Useful for when we need to customize response headers/init/etc.
})
Here are the bundle sizes of each import:
| Import | Minified | Minified + Gzip'd |
|---|---|---|
http-codex | 4.1 KB | 1.46 KB |
http-codex/status | 1.2 KB | 728 bytes |
http-codex/method | ~200 bytes | ~150 bytes |
Note: http-codex/status is smaller because it excludes the statusText() function. http-codex/method is the smallest as it only contains the HTTP method constants.
Honestly I just love Go and wanted one that was very similar to how Go's http package works.
FAQs
HTTP status codes and methods based on Go's http library
The npm package http-codex receives a total of 222 weekly downloads. As such, http-codex popularity was classified as not popular.
We found that http-codex demonstrated a healthy version release cadence and project activity because the last version was released less than 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 a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.