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-focusables
Advanced tools
Returns an array of all focusable descendants of the given element.
A vanilla JavaScript port of jquery-focusable.
This 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-focusables
// via yarn
yarn add makeup-focusables
Markup:
<div class="widget">
<h2 tabindex="-1">Widget Title</h2>
<p>Widget Text</p>
<button type="button">Widget Button</button>
<a href="#">Widget Link</a>
</div>
// require the module
const focusables = require('makeup-focusables');
// get element reference
const widgetEl = document.querySelector('.widget');
// get array of all focusable elements (keyboard and programmatic)
const allItems = focusables(widgetEl);
console.log(allItems.length) // outputs: 3
// get array of only keyboard focusable elements
const keyboardItems = focusables(widgetEl, true);
console.log(keyboardItems.length) // outputs: 2
el
: the element to search (default: undefined)keyboardOnly
: return only elements focusable in sequential keyboard navigation (default: false)npm start
npm test
npm run lint
npm run fix
npm run build
npm run clean
The following hooks exist, and do not need to be invoked manually:
npm prepublishOnly
cleans, lints, tests and builds on every npm publish
commandpre-commit
cleans, lints, tests and builds on every git commit
commandEach test run will generate the following reports:
/reports/coverage
contains Istanbul code coverage report/reports/html
contains HTML test reporthttps://travis-ci.org/makeup-js/makeup-focusables
FAQs
Returns an array of all focusable descendants of the given element
We found that makeup-focusables 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.