Installations
npm install @newhighsco/next-plugin-svgr
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
20.18.1
NPM Version
10.5.0
Score
31.3
Supply Chain
50.4
Quality
93.4
Maintenance
100
Vulnerability
91.6
License
Releases
Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
451,387
Last Day
781
Last Week
3,403
Last Month
15,147
Last Year
216,214
GitHub Statistics
69 Stars
1,736 Commits
3 Forks
1 Watching
1 Branches
4 Contributors
Package Meta Information
Latest Version
3.0.152
Package Id
@newhighsco/next-plugin-svgr@3.0.152
Unpacked Size
4.58 kB
Size
1.96 kB
File Count
4
NPM Version
10.5.0
Node Version
20.18.1
Publised On
17 Jan 2025
Total Downloads
Cumulative downloads
Total Downloads
451,387
Last day
20.2%
781
Compared to previous day
Last week
-5.1%
3,403
Compared to previous week
Last month
-14%
15,147
Compared to previous month
Last year
100.7%
216,214
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Peer Dependencies
1
next-plugin-svgr
Next.js plugin for transforming SVGs into React components using SVGR
Installation
Install Next.js and @newhighsco/next-plugin-svgr
:
npm install --save next @newhighsco/next-plugin-svgr
Usage
Create a next.config.js
in your project:
1// next.config.js
2const withSvgr = require('@newhighsco/next-plugin-svgr')
3module.exports = withSvgr({
4 svgrOptions: {
5 /* config options here */
6 }
7})
In your code:
1import starUrl, { ReactComponent as Star } from './star.svg' 2 3const App = () => ( 4 <> 5 <img src={starUrl} alt="star" /> 6 <Star /> 7 </> 8)
With TypeScript
In your next-env.d.ts
file (or in another type declaration file of your choosing that's within the include
section of your tsconfig.js
), simply add the following:
1declare module '*.svg' { 2 import { FC, SVGProps } from 'react'; 3 export const ReactComponent: FC<SVGProps<SVGSVGElement>>; 4 5 const src: string; 6 export default src; 7}
This notifies the compiler of the 2 possible ways you're able to import and use SVG files with this plugin integrated.
Options
CHANGELOG
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Reason
16 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More