jshttp / On Headers
Licence: mit
Execute a listener when a response is about to write headers.
Stars: ✭ 131
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to On Headers
Nuxt Netlify
Dynamically generate `_headers` and `_redirects` files for Netlify in your Nuxt.js projects
Stars: ✭ 97 (-25.95%)
Mutual labels: headers
Illuminati
This is a Platform that collects all the data accuring in your Application and shows the data in real time by using Kibana or other tools.
Stars: ✭ 106 (-19.08%)
Mutual labels: event
Kiss Headers
💡Python package for HTTP/1.1 style headers. Parse headers to objects. Most advanced available structure for http headers.
Stars: ✭ 91 (-30.53%)
Mutual labels: headers
Securityheaders
Check any website (or set of websites) for insecure security headers.
Stars: ✭ 104 (-20.61%)
Mutual labels: headers
Rxbus
Android reactive event bus that simplifies communication between Presenters, Activities, Fragments, Threads, Services, etc.
Stars: ✭ 79 (-39.69%)
Mutual labels: event
Bekit
bekit框架致力于解决在应用开发中的公共性痛点,已有“事件总线”、“流程引擎”、“服务引擎”。其中“流程引擎”可作为分布式事务解决方案saga模式的一种实现,并且它很轻量不需要服务端、不需要配置,就可直接使用。
Stars: ✭ 71 (-45.8%)
Mutual labels: event
Poweradapter
Adapter for RecyclerView(only 21KB).RecyclerView万能适配器(仅21KB)
Stars: ✭ 112 (-14.5%)
Mutual labels: headers
Metronome
Metronome is a distributed and fault-tolerant event scheduler
Stars: ✭ 131 (+0%)
Mutual labels: event
Neventlite
NEventLite - An extensible lightweight library for .NET that manages the Aggregate lifecycle in an Event Sourced system. Supports Event and Snapshot storage providers like EventStore/Redis or SQL Server. Built with dependency injection in mind and seamlessly integrates with AspNetCore.
Stars: ✭ 117 (-10.69%)
Mutual labels: event
Knot.js
A browser-based event emitter, for tying things together.
Stars: ✭ 100 (-23.66%)
Mutual labels: event
on-headers
Execute a listener when a response is about to write headers.
Installation
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install on-headers
API
var onHeaders = require('on-headers')
onHeaders(res, listener)
This will add the listener listener
to fire when headers are emitted for res
.
The listener is passed the response
object as it's context (this
). Headers are
considered to be emitted only once, right before they are sent to the client.
When this is called multiple times on the same res
, the listener
s are fired
in the reverse order they were added.
Examples
var http = require('http')
var onHeaders = require('on-headers')
http
.createServer(onRequest)
.listen(3000)
function addPoweredBy () {
// set if not set by end of request
if (!this.getHeader('X-Powered-By')) {
this.setHeader('X-Powered-By', 'Node.js')
}
}
function onRequest (req, res) {
onHeaders(res, addPoweredBy)
res.setHeader('Content-Type', 'text/plain')
res.end('hello!')
}
Testing
$ npm test
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].