
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
immutable-app-http-error
Advanced tools
Throws an error object that will be used by the immutable-app framework to generate the appropriate HTTP response.
const httpError = require('immutable-app-http-error')
httpError(404)
Error Code | Default Message |
---|---|
400 | Application Error |
403 | Access Denied |
404 | Not Found |
409 | Conflict |
500 | Internal Server Error |
httpError(code, message, data, cookies, headers)
httpError(123, 'FOOBAR')
httpError(409, null, {...})
Any error can have data attached. In the case of 409 Conflict errors the data will be returned as the response body along with the 409 status code.
httpError(400, null, null, {foo: bar})
The cookies aregument must be an object. Each property will be used as the cookie name and the value will be used to set/clear the cookie.
If the value is false the cookie is cleared.
If the value is a string the cookie will be set with default options.
If the value is an object the value property of the object will be used as the cookie value and the rest of the properties will be used to set the cookie options.
httpError(400, null, null, null, {foo: bar})
The headers argument must be an object. The properties and values will be used to set http headers for the response.
FAQs
Immutable app http error
The npm package immutable-app-http-error receives a total of 1 weekly downloads. As such, immutable-app-http-error popularity was classified as not popular.
We found that immutable-app-http-error 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.