Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
next-routes-readme
Advanced tools
Next Routes Readme is a cool utility that helps generate short and brief markdown documentation for Next App Routes (Next 13+). It automates the process of extracting information from your App Route files and creates well-structured markdown documentation.
npm install next-routes-readme
npx next-routes-readme --dir=<path-to-your-app-folder>
Replace <path-to-api-folder>
with the path to the folder containing your API routes.
Here is an example of the generated documentation for an API route:
---
# Route 1: [examples/app/route.ts](examples/app/route.ts)
**Implementation**: `async function POST(request: NextRequest)`
**HTTP Method**: `POST`
**Variables**:
1.
- **Value**: `const {
severity,
message,
functionName,
gcpProject,
serviceAccountEmail,
serviceAccountKey,
env,
} = await request.json();`
- **Line**: [examples/app/route.ts#L5](examples/app/route.ts#L5)
**Conditionals**:
1.
- **Value**: `if (
!severity ||
!message ||
!functionName ||
!gcpProject ||
!serviceAccountEmail ||
!serviceAccountKey ||
!env
) {
return NextResponse.json({ error: 'Invalid Request' }, { status: 500 });
}`
- **Line**: [examples/app/route.ts#L15](examples/app/route.ts#L15)
**Comments**:
1.
- **Value**: `// eslint-disable-next-line @typescript-eslint/no-explicit-any`
- **Line**: [examples/app/route.ts#L27](examples/app/route.ts#L27)
**Errors**:
1.
- **Value**: `NextResponse.json({ error: 'Invalid Request' }, { status: 500 })`
- **Line**: [examples/app/route.ts#L24](examples/app/route.ts#L24)
2.
- **Value**: `catch (error) {
console.error('Error logging to GCP:', error);
return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 });
}`
- **Line**: [examples/app/route.ts#L31](examples/app/route.ts#L31)
3.
- **Value**: `NextResponse.json({ error: 'Internal Server Error' }, { status: 500 })`
- **Line**: [examples/app/route.ts#L33](examples/app/route.ts#L33)
**Query Params**:
*None*
**Route Params**:
*None*
**Dependencies**:
1.
- **Value**: `import { NextRequest, NextResponse } from 'next/server';`
- **Line**: [examples/app/route.ts#L1](examples/app/route.ts#L1)
If you'd like to contribute to this project, please follow these steps:
This project is licensed under the MIT License.
FAQs
Creates README badges from istanbul coverage report
We found that next-routes-readme demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.