This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

express-dnt
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

npm

express-dnt

A simple middleware that adds a convenience property for the users Do-Not-Track preference.

Basic example

   const express = require('express')
   const expressDnt = require('express-dnt')

   const app = express()

   app.use(expressDnt())

   app.get('/', (req, res) => {
      res.end(`Do not track enabled: ${req.dnt}`)
      // req.dnt is either true or false
   })

Custom attribute name

   const express = require('express')
   const expressDnt = require('express-dnt')

   const app = express()

   app.use(expressDnt('doNotTrack')) // Pass a string with the custom property name

   app.get('/', (req, res) => {
      res.end(`Do not track enabled: ${req.doNotTrack}`)
   })

Dependents (0)

Package Sidebar

Install

npm i express-dnt

Weekly Downloads

5

Version

2.0.2

License

MIT

Unpacked Size

5.96 kB

Total Files

7

Last publish

Collaborators

  • wotschofsky