http-status-codes
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -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)) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27216
6
402
119
1