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 3.0.0 to 4.0.0

6

HISTORY.md

@@ -0,2 +1,8 @@

4.0.0 / 2016-06-07
==================
* add support for returning or `send`ing `Buffer`, `Stream` [@kevin-roark]
* add support host argument in micro(1) [@millette]
* clean up babel config [@hzoo]
3.0.0 / 2016-06-02

@@ -3,0 +9,0 @@ ==================

6

package.json
{
"name": "micro",
"version": "3.0.0",
"version": "4.0.0",
"description": "Async HTTP microservices",

@@ -26,3 +26,2 @@ "author": "rauchg",

"babel-plugin-module-alias": "1.1.1",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.4.6",

@@ -35,3 +34,3 @@ "babel-plugin-transform-runtime": "6.7.5",

"media-typer": "0.3.0",
"micro-core": "0.3.0",
"micro-core": "0.4.0",
"raw-body": "2.1.5"

@@ -70,4 +69,5 @@ },

"request-promise": "2.0.0",
"resumer": "0.0.0",
"then-sleep": "1.0.1"
}
}

@@ -36,2 +36,8 @@ ![](https://cldup.com/JDmmHX3uhF.svg)

To run the microservice on port `3000` and localhost instead of listening on every interface, use the `micro` command:
```bash
$ micro -p 3000 -h localhost sleep.js
```
## Documentation

@@ -76,2 +82,3 @@

-p, --port Port to listen on (3000)
-h, --host Host to listen on (0.0.0.0)
-n, --no-babel Skip Babel transformation

@@ -136,4 +143,8 @@

- `statusCode` is a `Number` with the HTTP error code, and must always be supplied.
- If `data` is supplied and is an `object`, it's automatically serialized as JSON. `Content-Type` and `Content-Length` are automatically set.
- If JSON serialization fails (for example, if a cyclical reference is found), a `400` error is thrown (see [Error Handling](#error-handling)).
- 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.
- `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).
- `Buffer`: `data` is written as an `octet-stream`.
- `object`: `data` is serialized as JSON.
- `string`: `data` is written as-is.
- If JSON serialization fails (for example, if a cyclical reference is found), a `400` error is thrown. See [Error Handling](#error-handling).
- Example

@@ -293,3 +304,2 @@

"transform-runtime",
"syntax-async-functions",
"transform-async-to-generator"

@@ -304,3 +314,2 @@ ]

{
"babel-plugin-syntax-async-functions": "6.3.13",
"babel-plugin-transform-async-to-generator": "6.4.6",

@@ -307,0 +316,0 @@ "babel-plugin-transform-runtime": "6.4.3",

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