Skip to content

Conversation

@Danilqa
Copy link
Owner

@Danilqa Danilqa commented Nov 27, 2025

snyk-top-banner

Snyk has created this PR to upgrade node-file-router from 0.6.0 to 0.8.0.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 2 versions ahead of your current version.

  • The recommended version was released 10 months ago.

Release notes
Package name: node-file-router
  • 0.8.0 - 2025-02-01

    What's new

    Features

    Now, node-file-router supports the ability to read of parsed routes. Simply get it from onInit callback:

    await initFileRouter({
      onInit: ({ routes }) => {
        console.log({ routes })
      }
    });

    Full Changelog: v0.7.0...v0.8.0

  • 0.7.0 - 2025-01-25

    What's new

    Features

    Now, node-file-router supports classes. The main requirement is that it should be the default export.

    export default class Resource {
    get(req, res, routeParams) {
    const { documentId, draftId } = routeParams;
    res.end(Requested document <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">documentId</span><span class="pl-kos">}</span></span> and his draft <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">draftId</span><span class="pl-kos">}</span></span>);
    }

    post(req, res, routeParams) {
    const { documentId, draftId } = routeParams;
    res.end(Created draft <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">draftId</span><span class="pl-kos">}</span></span> for document <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">documentId</span><span class="pl-kos">}</span></span>);
    }

    patch(req, res, routeParams) {
    // ...
    }
    }

    Alternatively, you can export a class instance:

    class SomeResource {
    get(req, res, routeParams) {
    // ...
    }
    }

    export default new SomeResource();




  • 0.6.0 - 2024-02-24

    What's new

    Features

    Added the ability to modify or override a final result in middlewares (#41).

    For example, you can now set response headers in Bun inside middlewares:

    import type { NextFunction } from 'node-file-router';

    export async function useCors(req: Request, next: NextFunction<Response>) {
    const res = await next();

    res.headers.set('Access-Control-Allow-Methods', 'PUT, POST, OPTIONS, HEAD');

    return res;
    }

    Documentation

from node-file-router GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:


Note

Upgrade node-file-router from 0.6.0 to 0.8.0 in examples/published-package/package.json.

Written by Cursor Bugbot for commit 68bad92. This will update automatically on new commits. Configure here.

Snyk has created this PR to upgrade node-file-router from 0.6.0 to 0.8.0.

See this package in npm:
node-file-router

See this project in Snyk:
https://app.snyk.io/org/danilqa/project/5d7da9b3-d0d7-474d-8ff4-b86b3409bfab?utm_source=github&utm_medium=referral&page=upgrade-pr
@vercel
Copy link

vercel bot commented Nov 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
node-file-router Ready Ready Preview Comment Nov 27, 2025 6:50am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants