New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-link-checker

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-link-checker

nuxt-link-checker

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by4.28%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version NPM Downloads GitHub stars

Improve your sites SEO by identifying and fixing link issues in your Nuxt 3 app.


Status: Early Access
Please report any issues 🐛
Made possible by my Sponsor Program 💖
Follow me @harlan_zw 🐦 • Join Discord for help

ℹ️ Looking for a complete SEO solution? Check out nuxt-seo-kit.

Features

  • ✅ Discover broken links - 404s and internal redirects
  • 🕵️ Fail on build if broken links are found (optional)

Install

⚠️ The module is in early access and only works when pre-rendering.

npm install --save-dev nuxt-link-checker

# Using yarn
yarn add --dev nuxt-link-checker

Setup

nuxt.config.ts

export default defineNuxtConfig({
  modules: [
    'nuxt-link-checker',
  ],
})

To have routes scanned for broken links automatically, they need to be pre-rendered by Nitro.

export default defineNuxtConfig({
  nitro: {
    prerender: {
      crawlLinks: true,
      routes: [
        '/',
        // any URLs that can't be discovered by crawler
        '/my-hidden-url'
      ]
    }
  }
})

Set host (optional)

You'll need to provide the host of your site so that the crawler can resolve absolute URLs that may be internal.

export default defineNuxtConfig({
  // Recommended 
  runtimeConfig: {
    siteUrl: 'https://example.com',
  },
  // OR 
  sitemap: {
    host: 'https://example.com',
  },
})

Module Config

failOn404

  • Type: boolean
  • Default: true

If set to true, the build will fail if any broken links are found.

host

  • Type: string
  • Default: runtimeConfig.public.siteUrl || localhost
  • Required: false

The host of your site. This is required to validate absolute URLs which may be internal.

trailingSlash

  • Type: boolean
  • Default: false

Whether internal links should have a trailing slash or not.

Sponsors

License

MIT License © 2022-PRESENT Harlan Wilton

FAQs

Package last updated on 07 Jan 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc