Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-status-codes

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-status-codes - npm Package Compare versions

Comparing version 1.1.6 to 1.2.0

index.d.ts

2

index.js

@@ -75,2 +75,2 @@ /**

}
};
};
{
"name": "http-status-codes",
"version": "1.1.6",
"version": "1.2.0",
"description": "Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.",

@@ -23,3 +23,4 @@ "scripts": {

"author": "Bryce Neal",
"license": "MIT"
"license": "MIT",
"typings": "index.d.ts"
}

@@ -7,2 +7,4 @@ # http-status-codes

Completely library agnostic. No dependencies.
## Installation

@@ -87,1 +89,33 @@

USE_PROXY | 305 | Use Proxy
## TypeScript
There is an included definition file that adds rules for use, comments, and links to official documentation.
### Usage
Option 1: Full import of package
```typescript
import * as HttpStatus from 'http-status-codes'
response
.status(HttpStatus.OK)
.send('ok')
response
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.send({
error: HttpStatus.getStatusText(HttpStatus.INTERNAL_SERVER_ERROR)
})
```
Option 2: Selective import
```typescript
import { OK, getStatusText } from 'http-status-codes'
response
.status(OK)
.send(getStatusText(OK))
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc