Socket
Socket
Sign inDemoInstall

express

Package Overview
Dependencies
Maintainers
0
Versions
279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express - npm Package Compare versions

Comparing version 2.3.12 to 2.4.0

7

History.md
2.4.0 / 2011-06-28
==================
* Added chainable `res.status(code)`
* Added `res.json()`, an explicit version of `res.send(obj)`
* Added simple web-service example
2.3.12 / 2011-06-22

@@ -3,0 +10,0 @@ ==================

2

lib/express.js

@@ -31,3 +31,3 @@

exports.version = '2.3.12';
exports.version = '2.4.0';

@@ -34,0 +34,0 @@ /**

@@ -117,5 +117,42 @@

this.end('HEAD' == this.req.method ? undefined : body);
return this;
};
/**
* Send JSON response with `obj`, optional `headers`, and optional `status`.
*
* Examples:
*
* res.json(null);
* res.json({ user: 'tj' });
* res.json('oh noes!', 500);
* res.json('I dont have that', 404);
*
* @param {Mixed} obj
* @param {Object|Number} headers or status
* @param {Number} status
* @return {ServerResponse}
* @api public
*/
res.json = function(obj, headers, status){
this.charset = this.charset || 'utf-8';
this.header('Content-Type', 'application/json');
return this.send(JSON.stringify(obj), headers, status);
};
/**
* Set status `code`.
*
* @param {Number} code
* @return {ServerResponse}
* @api public
*/
res.status = function(code){
this.statusCode = code;
return this;
};
/**
* Transfer the file at the given `path`. Automatically sets

@@ -122,0 +159,0 @@ * the _Content-Type_ response header field. `next()` is called

{
"name": "express",
"description": "Sinatra inspired web development framework",
"version": "2.3.12",
"version": "2.4.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -6,0 +6,0 @@ "contributors": [

Sorry, the diff of this file is not supported yet

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