Socket
Socket
Sign inDemoInstall

fastify

Package Overview
Dependencies
59
Maintainers
2
Versions
282
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.5.0

test/internals/tier-node.test.js

6

fastify.js

@@ -8,2 +8,3 @@ 'use strict'

const https = require('https')
const pinoHttp = require('pino-http')

@@ -20,2 +21,6 @@ const supportedMethods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT', 'OPTIONS']

options.logger = options.logger || {}
options.logger.level = options.logger.level || 'fatal'
const logger = pinoHttp(options.logger)
const router = wayfarer('/404')

@@ -52,2 +57,3 @@ const map = new Map()

function fastify (req, res) {
logger(req, res)
router(stripUrl(req.url), req, res)

@@ -54,0 +60,0 @@ }

2

lib/tier-node.js

@@ -76,2 +76,3 @@ 'use strict'

res.end()
return
}

@@ -93,2 +94,3 @@

res.end()
return
}

@@ -95,0 +97,0 @@

@@ -61,1 +61,2 @@ 'use strict'

module.exports = { build, validate, serialize }
module.exports.symbols = { payloadSchema, querystringSchema, outputSchema, paramsSchema }

26

package.json
{
"name": "fastify",
"version": "0.4.0",
"version": "0.5.0",
"description": "Fast and low overhead web framework, for Node.js",
"main": "fastify.js",
"scripts": {
"test": "standard | snazzy && tap test/*.test.js"
"test": "standard | snazzy && tap test/*.test.js test/*/*.test.js",
"coverage": "tap --cov --coverage-report=html test/*.test.js test/*/*.test.js",
"coveralls": "tap test/*test.js test/*/*.test.js --cov --coverage-report=text-lcov | coveralls"
},

@@ -28,22 +30,24 @@ "repository": {

"devDependencies": {
"coveralls": "^2.11.15",
"express": "^4.14.0",
"hapi": "^15.1.1",
"hapi": "^15.2.0",
"koa": "^1.2.4",
"pre-commit": "^1.1.3",
"request": "^2.75.0",
"restify": "^4.1.1",
"request": "^2.79.0",
"snazzy": "^5.0.0",
"standard": "^8.4.0",
"split2": "^2.1.0",
"standard": "^8.6.0",
"take-five": "^1.3.0",
"tap": "^7.1.2"
"tap": "^8.0.1"
},
"dependencies": {
"ajv": "^4.7.7",
"ajv": "^4.9.0",
"body": "^5.1.0",
"boot-in-the-arse": "^0.3.0",
"fast-json-stringify": "^0.10.0",
"fast-safe-stringify": "^1.1.0",
"fast-json-stringify": "^0.10.1",
"fast-safe-stringify": "^1.1.3",
"pathname-match": "^1.2.0",
"wayfarer": "^6.2.1"
"pino-http": "^2.1.0",
"wayfarer": "^6.3.0"
}
}

@@ -13,2 +13,3 @@ # Fastify  [![Build Status](https://travis-ci.org/mcollina/fastify.svg)](https://travis-ci.org/mcollina/fastify) [![Coverage Status](https://coveralls.io/repos/github/mcollina/fastify/badge.svg?branch=master)](https://coveralls.io/github/mcollina/fastify?branch=master)

* [API](#api)
* [Logging](#logging)
* [Team](#team)

@@ -268,2 +269,21 @@ * [Acknowledgements](#acknowledgements)

<a name="logging"></a>
## Logging
Since Fastify is really focused on performances, we choose the best logger to achieve the goal. **[Pino](https://github.com/pinojs/pino)**!
By default Fastify uses [pino-http](https://github.com/pinojs/pino-http) as logger, with the log level setted to `'fatal'`.
If you want to pass some options to the logger, just pass the logger option to fastify.
You can find all the options [here](https://github.com/pinojs/pino#pinoopts-stream). If you want to pass a custom stream to the Pino instance, just add the stream field to the logger object.
```js
const split = require('split2')
const stream = split(JSON.parse)
const fastify = require('fastify')({
logger: {
level: 'info',
stream: stream
}
})
```
<a name="team"></a>

@@ -270,0 +290,0 @@ ## The Team

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc