
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
void-elements
Advanced tools
The void-elements npm package provides a list of HTML void elements. Void elements are HTML elements that do not have closing tags, such as <img>, <br>, and <input>. This package is useful for developers who need to handle or validate HTML content programmatically.
List of Void Elements
This feature provides a list of all HTML void elements. The code sample demonstrates how to import the package and log the list of void elements to the console.
const voidElements = require('void-elements');
console.log(voidElements);
Check if an Element is Void
This feature allows you to check if a given HTML tag is a void element. The code sample shows how to create a function that checks if a tag name is in the list of void elements and demonstrates its usage with 'img' and 'div' tags.
const voidElements = require('void-elements');
const isVoidElement = (tagName) => voidElements.includes(tagName);
console.log(isVoidElement('img')); // true
console.log(isVoidElement('div')); // false
The html-tags package provides a list of all standard HTML tags, including both void and non-void elements. It is more comprehensive than void-elements as it covers all HTML tags, not just void elements.
The self-closing-tags package offers a list of self-closing HTML tags, which is similar to void elements. However, it focuses on tags that can self-close in XML and XHTML contexts, which may include more than just the standard HTML void elements.
Exports an Object
of "void element" node names as defined by the HTML spec.
The list is programatically generated from the latest W3C HTML draft.
var voidElements = require('void-elements');
assert(!voidElements['span'], '<span> is not a void element');
assert(voidElements['img'], '<img> is a void element');
MIT
FAQs
Array of "void elements" defined by the HTML specification.
The npm package void-elements receives a total of 7,906,866 weekly downloads. As such, void-elements popularity was classified as popular.
We found that void-elements demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.