1.0.1 • Published 10 months ago

linkcheckup v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago
# URLValidator

**URLValidator** is a simple command-line tool that scans files for URLs and checks their validity. It reports both valid and broken links, highlighting broken links with the HTTP status code if available.

## Features

- Scans multiple file types such as `.json`, `.md`, `.yml`, `.ts`, `.tsx`, `.js`, `.jsx`, `.html`, `.txt`, `.py` for URLs.
- Skips certain directories (`node_modules`, `.next`, `dist`, `build`, `.cache`) and excluded files like `package.json`, `package-lock.json`.
- Reports broken links with error codes and highlights them.
- Counts the number of broken and valid links.

## Installation

To install this tool globally, you can use `npm`:

```bash
npm install -g urlvalidator

Usage

Once installed globally, you can run the tool from the command line in any project directory.

linkchecker

The tool will automatically scan all supported files in the current directory and subdirectories, then display results for both valid and broken links.

Example

  1. Navigate to your project folder:

    cd /path/to/your/project
  2. Run the linkchecker command:

    linkchecker

    You'll see an output like:

    Starting LinkChecker...
    valid: https://example.com in /path/to/file.js
    broken: https://broken-link.com in /path/to/another-file.md (Status: 404)
    ...
    Link Checking Complete.
    Total broken links: 2
    - https://broken-link.com
    - https://another-broken-link.com

File Types Supported

By default, the following file extensions are scanned:

  • .json
  • .md
  • .yml
  • .ts
  • .tsx
  • .js
  • .jsx
  • .html
  • .txt
  • .py

Configuration

You can modify the tool by editing the following configurations:

  • Excluded Directories: Currently, it skips directories like node_modules, .next, dist, build, .cache. If you need to include or exclude specific directories, modify the getFilesFromDirectory() function in src/index.js.
  • Excluded Files: Files like package.json and package-lock.json are excluded. You can modify this list in src/index.js.

License

This project is licensed under the MIT License.

Author

Created by Gowreesh Simhadri

1.0.1

10 months ago

1.0.0

10 months ago