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.
This is a really simple component that can automatically handle loading Google fonts for you.
You simply pass it a config array and it will load the fonts for you by appending a <link />
tag to the document head. It will update itself if the config changes, and will remove itself on unmount.
Install with either yarn or npm:
yarn add rgfl
npm install --save rgfl
// Import the Component, you can call it whatever you like.
import ReactGFL from 'rgfl';
const App = () => (
<>
{/* Use it! */}
<ReactGFL
fonts={[
{
font: 'Roboto',
weights: [400, '400i'],
},
{
font: 'Roboto Mono',
weights: [400, 700],
},
]}
subsets={['cyrillic-ext', 'greek']}
/>
<p style={{ fontFamily: 'Roboto Mono, monospaced' }}>This will be in Roboto Mono!</p>
<p style={{ fontFamily: 'Roboto, sans-serif' }}>This will be in Roboto!</p>
</>
);
The Component takes two props: fonts
and subsets
.
fonts
fonts
should be an array of objects describing the fonts you want to load:
[
{
font: 'Roboto Mono', // The name of the font on Google Fonts.
weights: [400, 700], // An array of weights you want to load, can be strings or numbers.
},
// ...
// You can include as many of these objects as you want.
]
subsets
subsets
should be an array of subsets you want to load. This prop is optional - if you do not specify a subsets
prop then the 'subset' query param will be omitted from the URL and only latin will be loaded.
['cyrillic-ext', 'greek']
FAQs
React component to load Google Fonts.
The npm package rgfl receives a total of 0 weekly downloads. As such, rgfl popularity was classified as not popular.
We found that rgfl 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.