
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.
mongo-objectid
Advanced tools
A MongoDB specification based implementation of ObjectID
Goal is to provide a correct MongoDB ObjectID implementation, in order to ensure impossibility to create similar entries on fast generation (as saw on other open source package)
npm install mongo-objectid
mkdir myproject
cd myproject
npm init
npm install mongo-objectid
touch index.js
And there just use that snipets to start playing ! :
const ObjectId = require('mongo-objectid');
const id = new ObjectId();
constructor([hexid])toString()Returns the ID
.isValid()Validate the ID against specification.
.setMachineId([machineId])This will set a new machine id and regenerate new id (careful, timevalue also change with this process).
.generateNew([time])Allow to generate a new ID
.getDate()Return the Date object corresponding to the time of the ObjectID creation
.getTimestamp()Return the timestamp in ms corresponding to the time of ObjectID creation
For development purpose, I decided that being able to console view the object without all the nested parent thing was handy a clean.
That's the only reason. But Node V.12 is old enough already, no point sticking to the past.
FAQs
A MongoDB specification based implementation of ObjectID
The npm package mongo-objectid receives a total of 630 weekly downloads. As such, mongo-objectid popularity was classified as not popular.
We found that mongo-objectid 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.