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

express-semantic-response

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-semantic-response - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

package.json
{
"name": "express-semantic-response",
"version": "0.1.0",
"version": "0.1.1",
"description": "Remembering which response code to use is error prone and unsexy. Let these semantic response extensions increase your sex-appeal and reduce your error-pronity.",

@@ -8,2 +8,3 @@ "main": "src/index.js",

"license": "MIT",
"repository": "prodatakey/express-semantic-response",
"peerDependencies": {

@@ -10,0 +11,0 @@ "express": ">4.0.0"

@@ -15,1 +15,16 @@ This module extends express' response object with semantic syntactic sugar that makes responding to API requests less error-prone.

The response object on all requests made to your app will now have all of the helpers defined in this module.
##Response Handlers
###res.sendDeleted()
When deleting an entity we send a 204 'No Content' status with no body
###res.sendCreated(location, body)
When creating an entity we send:
- A location header pointing to the created entity
- The newly created entity as the body
- Status 201 'Created'
####Parameters
* **location** - The location of the created entity to set in the `Location` header.
* **body** - The object that was created to send back to the client. This serializes the content using the same semantics as [send](http://expressjs.com/api.html#res.send).
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