Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
makeup-next-id
Advanced tools
Assign the next id in sequence to an element, if an id property does not already exist.
Assigns the next id in sequence to an element, if an id property does not already exist. The id will consist of a configurable prefix (default: 'nid'), followed by three randomly generated chars, then a number in sequence. For example: nid-sdv-1
, nid-sdv-2
, nid-sdv-3
, etc. If you need a known id, ahead of time, please use a different approach!
This CommonJS module is still in an experimental state, until it reaches v1.0.0 you must consider all minor releases as breaking changes. Patch releases may introduce new features, but will be backwards compatible.
// via npm
npm install makeup-next-id
// via yarn
yarn add makeup-next-id
// require the module
const nextId = require('makeup-next-id');
// get NodeList
const widgets = document.querySelectorAll('.widget');
// assign next id to each element
widgets.forEach(function(el) {
nextId(el);
});
Markup before:
<div class="widget"></div>
<div class="widget"></div>
<div class="widget"></div>
Markup after:
<div class="widget" id="nid-tCa-1"></div>
<div class="widget" id="nid-tCa-2"></div>
<div class="widget" id="nid-tCa-3"></div>
FAQs
Assign the next id in sequence to an element, if an id property does not already exist.
The npm package makeup-next-id receives a total of 95 weekly downloads. As such, makeup-next-id popularity was classified as not popular.
We found that makeup-next-id demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.