
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
express-chrono
Advanced tools
Simple hrtime chronometer with Expressjs middleware. Request timer, process timer.
Simple process.hrtime chronometer with Expressjs middleware. Request timer, process timer.
const express = require("express");
const app = express();
const chrono = require("express-chrono")({ header: true });
app.use(chrono.middleware.start);
app.get("/", (req, res, next)=> {
res.send("Hello World");
next();
});
app.use(chrono.middleware.stop);
app.use((req, res, next) => {
console.log(req.chrono);
});
app.listen(3000);
Options
header - boolean or string of the header name. Defaults to false. If true the default header is X-Response-Time
format
1.029382120s
1029.382120ms
suffix - boolean, default false; include the second or millisecond suffix
Module
const chrono = require("express-chrono")(options);
chrono.middleware
chrono
on req of type Chronometer
req.chrono
. You can stop the timer at any time from req.chrono.stop()
or look at the current accumulated time req.chrono.parse()
class Chronometer
constructor(options) - options, same as above, except header
Properties
diff - returns start time hrtime diff of now or diff since stopped. hrtime - hrtime at start or now if not started.
Methods
start() - starts the chronometer at that moment
stop() - stops the chronometer at that moment
parse(format, suffix) - returns the parsed time so far or since stopped. format and suffix are optional, inheritted from constructor, if provided they will override Chronometer instance options.
toJSON() - returns parse()
toString() - returns parse()
valueOf() - returns current diff or diff since stopped in seconds fixed decimal number with percision of 9.
const Chronometer = require("express-chrono").Chronometer;
let chrono = new Chronometer({ format: "ms", suffix: true });
chrono.start();
setTimeout(() => {
chrono.stop();
console.log(chrono); // 100ms
}, 100);
FAQs
Simple hrtime chronometer with Expressjs middleware. Request timer, process timer.
The npm package express-chrono receives a total of 287 weekly downloads. As such, express-chrono popularity was classified as not popular.
We found that express-chrono 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.