Installations
npm install @hashicorp/netlify-to-nextjs-redirect-exporter
Score
67.7
Supply Chain
78.4
Quality
83
Maintenance
100
Vulnerability
81.3
License
Developer
hashicorp
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
12.16.2
NPM Version
6.14.4
Statistics
6 Stars
22 Commits
2 Forks
5 Watching
10 Branches
38 Contributors
Updated on 13 Aug 2024
Languages
TypeScript (52.93%)
JavaScript (47.07%)
Total Downloads
Cumulative downloads
Total Downloads
110,410
Last day
150%
15
Compared to previous day
Last week
41.8%
78
Compared to previous week
Last month
-2.6%
263
Compared to previous month
Last year
-25.2%
2,691
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
6
netlify-to-nextjs-redirect-exporter
A Node.js library and CLI that converts a Netlify _redirects
file into compatible Next.js redirect/rewrite rules
Installation
1npm i @hashicorp/netlify-to-nextjs-redirect-exporter
Usage
Node.js
1// next.config.js 2import { parseNetlifyRedirects } from "@hashicorp/netlify-to-nextjs-redirect-exporter"; 3 4const contents = fs.readFileSync("/path/to/_redirects/file", "utf8"); 5 6// `parseNetlifyRedirects()` will return an object with two keys: 7// `rewrites` and `redirects`, each containing an array of corresponding rules 8const { rewrites, redirects } = parseNetlifyRedirects(contents); 9 10module.exports = { 11 async rewrites() return rewrites 12 async redirects() return redirects 13}
CLI
Using the export-netlify-redirects
CLI will create two files: rewrites.next.js
and redirects.next.js
,
each containing an array of corresponding rules.
1$ ./node_modules/.bin/export-netlify-redirects ./_redirects 2 3Writing redirects file to redirects.next.js... 4Writing rewrites file to rewrites.next.js... 5Done.
Active Development
1npm i 2npm run watch
Run tests
1npm t
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
all dependencies are pinned
Details
- Info: 1 out of 1 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Mozilla Public License 2.0: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/hashicorp/.github/SECURITY.md:1
- Info: Found linked content: github.com/hashicorp/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/hashicorp/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/hashicorp/.github/SECURITY.md:1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Reason
30 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- 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-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- 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-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
3.8
/10
Last Scanned on 2024-11-25
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