
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
An Express middleware to show those you don't like how much you really don't like them by adding a delay to your server's responses based on conditions you provide.
Did your boss add busy work to your already slammed plate during the last 1-on-1? Are you Bruce Wayne and Clark Kent is accessing your app and you want to show him who's boss? Is your CEO taking too many golf trips? Oh your ex just signed up to use your company's app(s)? Lulz, we'll see about that.
$ npm install nawdawg
import express from 'express'
import nawdawg from 'nawdawg'
const app = express()
// no arguments delays all requests by 100ms
app.use(nawdawg())
app.get('/', (req, res) => {
res.send('At least 100ms has passed')
})
app.listen(8080)
import express from 'express'
import nawdawg from 'nawdawg'
const app = express()
// delay all requests by 1 second (1000 milliseconds)
app.use(nawdawg(1000))
app.get('/', (req, res) => {
res.send('At least 1 second has passed')
})
app.listen(8080)
import express from 'express'
import nawdawg from 'nawdawg'
const app = express()
// delay all requests by user pos@acme.com (as defined in a session object on request) by 3 seconds
app.use(
nawdawg({
delay: 3000,
delayer(req) {
if (req.session.user === 'pos@acme.com') {
return true
}
return false
},
})
)
app.get('/', (req, res) => {
res.send(`If you're pos@acme.com, at least 3 seconds has passed`)
})
app.listen(8080)
import express from 'express'
import nawdawg from 'nawdawg'
const app = express()
// delay all requests by `userObject.delayByThisManyMilliseconds` number of milliseconds
// as defined by a column in the DB
app.use(
nawdawg({
async delayer(req) {
const userObject = await findUser(req.session.user)
const milliseconds = userObject && userObject.delayByThisManyMilliseconds
return milliseconds || false
},
})
)
app.get('/', (req, res) => {
res.send(
`If you're logged in and have a delayByThisManyMilliseconds, at least that many milliseconds has passed`
)
})
app.listen(8080)
nawdawg takes an optional options parameter that can be either a number that will delay all incoming requests by that number of milliseconds, or an object with the following parameters to control if and how to delay requests:
If options is not provided all requests will be delayed by 100ms.
options.delayer?: (req: express.Request): boolean | Promise<boolean> | number | Promise<number>
true and will be delayed by options.delay millisecondsoptions.delay?: number = 100: the number of milliseconds to delay if options.delayer returns a boolean. If options.delayer returns a number, it will take precendent over options.delay.import express from 'express'
import nawdawg from 'nawdawg'
const app = express()
app.use(nawdawg(options))
FAQs
Express middleware to add a delay to your responses to those you don't like.
We found that nawdawg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.