express-save-data
v1.0.1
Published
Express middleware to check "data saver" header on requests
Downloads
4
Readme
express-save-data
Express middleware to check "data saver" header on requests. This header is currently used in the Chrome, Opera, and Yandex browsers.
For more click here
Install
npm install -s express-save-data
Usage
Use it like any middleware for express:
const expressSaveData = require("express-save-data")
app.get("/", expressSaveData, function(req, res){
if req.dataSaver{ //alternatively, you can use req.saveData
//Save-data is ON
}
else{
//Save-data is OFF
}
})