
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Trivial request ID generator - crafts random id for a process and adds fast sequential ids on each call. Designed for request/response logging and error tracking.

It uses crypto for random string generation, has no external dependencies and
is thoroughly tested in production. The reason this package has been created is
that hyperid (the package I originally used) has too long random parts. Also
I felt like I don't need encoding/decoding. TRID ids are url-safe and
NATS-subject-safe.
npm i trid
Initialize TRID with the rest of your service:
const TRID = require('trid');
const id = new TRID({prefix: 'srv1', length: 4});
Get service instance id with trid.base():
console.log(`Starting server instance: ${id.base()}`);
Starting server instance: srv1.4D2m
Use trid.seq() to identify requests (as well as responses) or other activity:
...
console.log(`${timestamp} ${LEVEL} [${id.seq()}] performing request...`)
...
2018-04-02T12:17:12.654Z DEBUG [srv1.4D2m.42] performing request...
new TRID({...}) - you can define the following parameters while constructing
a trid instance:
prefix is added to the beginning of an id (default - empty string),length of the random part (default - 5)count - starting sequential counter value.
An id basically is generated like this: {prefix}.{random}.{counter}trid.base() - returns base part of the id ({prefix}.{random}). Good for
server instance identification.
trid.seq() - returns sequential id: {prefix}.{random}.{counter}. Note:
when counter reaches Number.MAX_SAFE_INTEGER, the base value is regenerated
and the counter is restarted
This is how trid ids look in tasu:

(code)
FAQs
Trivial request ID generator
The npm package trid receives a total of 100 weekly downloads. As such, trid popularity was classified as not popular.
We found that trid 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.