
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
@nelsongomes/ts-timeframe
Advanced tools
Benchmark framework to collect code time metrics and excel in precision.
A reliable, lightweight, fine grained javascript library for high performance backend applications, built with Typescript and with 100% code coverage. It allows to measure individual events, but also to trigger callbacks according to defined rules.
Using npm:
$ npm i --save ts-timeframe
Simple usage example in typescript (constructor default is ms, 3 decimals):
import { Timeline } from "ts-timeframe";
// we start timeline
const timeline = new Timeline();
const event = timeline.startEvent();
// we do something
event.end();
timeline.end();
// get timeline duration
timeline.duration();
More complex usage:
import { Timeline, ITimelineUnit } from "ts-timeframe";
// timeline in microseconds, no decimals in precision
const timeline = new Timeline(ITimelineUnit.Microseconds, 0);
// label the event and add info for the callback to receive
const event = timeline.startEvent(["database", "delete"], {
  table: "x",
  server: "1"
});
// we do something
event.end();
timeline.end();
// get timeline duration
timeline.duration();
timeline.generateAnalyticInfo();
Sample output:
***** Analytic Information for this Timeline *****
Total events: 1
Grand duration: 299.99900 µs
Events duration: 100.00000 µs
***** Event Detail for this Timeline *****
#1: [started: 99.99900 µs, duration: 100.00000 µs, labels: database,mysql]
Changing defaults (callable once) and adding slowEvents rules:
import { Timeline } from "ts-timeframe";
Timeline.init({
  unit: ITimelineUnit.Milliseconds, // default unit for constructor class
  precision: 5, // decimals for unit
  // a list of event rules to trigger a callback
  // if they take longer than duration and label matches
  // with this you can log queries or requests,
  // all callbacks are called after timeline end.
  slowEvents: [
    {
      callback: () => {
        /* some action */
      },
      rule: {
        duration: 100,
        matchAnylabel: ['database'],
        message: 'Database too slow'
      }
    },
    {
      callback: () => {
        /* some action */
      },
      rule: {
        duration: 3000,
        matchAnylabel: ['api'],
        message: 'Api calls too slow'
      }
    }
  ]
});
(...)
FAQs
Benchmark framework to collect code time metrics and excel in precision.
The npm package @nelsongomes/ts-timeframe receives a total of 0 weekly downloads. As such, @nelsongomes/ts-timeframe popularity was classified as not popular.
We found that @nelsongomes/ts-timeframe 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.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.