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

micro

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro - npm Package Compare versions

Comparing version 8.0.3 to 8.0.4

3

lib/index.js

@@ -8,2 +8,3 @@ // Native

const typer = require('media-typer')
const { readable } = require('is-stream')

@@ -46,3 +47,3 @@ const { NODE_ENV } = process.env

if (obj instanceof Stream) {
if (obj instanceof Stream || readable(obj)) {
if (!res.getHeader('Content-Type')) {

@@ -49,0 +50,0 @@ res.setHeader('Content-Type', 'application/octet-stream')

{
"name": "micro",
"version": "8.0.3",
"version": "8.0.4",
"description": "Asynchronous HTTP microservices",

@@ -59,2 +59,3 @@ "main": "./lib/index.js",

"dependencies": {
"is-stream": "1.1.0",
"media-typer": "0.3.0",

@@ -61,0 +62,0 @@ "mri": "1.1.0",

@@ -187,3 +187,3 @@ <img src="https://raw.githubusercontent.com/zeit/art/6451bc300e00312d970527274f316f9b2c07a27e/micro/logo.png" width="50"/>

- Use `require('micro').send`.
- `statusCode` is a `Number` with the HTTP error code, and must always be supplied.
- `statusCode` is a `Number` with the HTTP status code, and must always be supplied.
- If `data` is supplied it is sent in the response. Different input types are processed appropriately, and `Content-Type` and `Content-Length` are automatically set.

@@ -190,0 +190,0 @@ - `Stream`: `data` is piped as an `octet-stream`. Note: it is _your_ responsibility to handle the `error` event in this case (usually, simply logging the error and aborting the response is enough).

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