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.
react-currency-flags
Advanced tools
Using the images from transferwise/currency-flags, this library uses styled-components
to create React components for use in your app. Please be aware that the images are in base64 format, so if you are concerned with the bundle size, I suggest that you clone the aforementioned TransferWise's repo and store it in a CDN solution of your own (the distributed format that repo is also base64 when built, so simply installing that module won't work).
$ yarn add react-currency-flags
$ npm install react-currency-flags
import CurrencyFlag from 'react-currency-flags';
const CurrencyFlagComponent1 = () => <CurrencyFlag currency="USD" size="sm" />;
const CurrencyFlagComponent2 = () => <CurrencyFlag currency="EUR" width={38} />;
sm
, md
, lg
, xl
You should provide either the size
, or width
or height
; size
will take precedence if all values are provided.
See examples in the examples
folder.
While SVG provides the advantage of scaling, but some flags, such as Mexico's, are very complicated graphically, and would therefore create incredibly large file sizes.
FAQs
React styled-component for currency flags
We found that react-currency-flags 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.