Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gatsby-plugin-smoothscroll
Advanced tools
Polyfilled smooth scrolling behavior and helper function for Gatsby sites.
Polyfilled smooth scrolling behavior and helper function for Gatsby sites.
The plugin uses smoothscroll-polyfill
and calls it during the onClientEntry
Gatsby lifecycle method.
It also includes a scrollTo
helper function as its main export that you can use as onClick
event handlers to scroll to the desired element using { behavior: 'smooth' }
.
# npm
npm install gatsby-plugin-smoothscroll
# yarn
yarn add gatsby-plugin-smoothscroll
When you want a polyfilled smooth scroll behavior without having to manually install and call the polyfill.
Just add the plugin to the plugins array in your gatsby-config.js
:
plugins: [`gatsby-plugin-smoothscroll`];
If you want to use the helper function, import it:
// this could be in your `pages/index.js` file
import scrollTo from 'gatsby-plugin-smoothscroll';
Then use it as an onClick
event handler:
<button onClick={() => scrollTo('#some-id')}>My link</button>
Be aware that scrollTo
uses document.querySelector()
under the hood, so make sure to respect its syntax.
FAQs
Polyfilled smooth scrolling behavior and helper function for Gatsby sites.
The npm package gatsby-plugin-smoothscroll receives a total of 6,892 weekly downloads. As such, gatsby-plugin-smoothscroll popularity was classified as popular.
We found that gatsby-plugin-smoothscroll 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.