link_checker 2.0.2

  • Example
  • Installing
  • Versions
  • 50

link_checker #

Can find links and check if they're dead in almost any file.

Are you tired of finding dead links in projects from READMEs to large websites? Yes, yes you are. link_checker allows you to test for dead links, whether it be a single link, a file, or an entire project, all with a single line! It can check most types of file, such as Java, Dart, and Markdown. link_checker can efficiently search your entire project by allowing you to blacklist directories, blacklist links using regex, etc.

The only caveat is that since Markdown files are parsed, the links obtained from them may differ from the original links.

You'll probably want the CI to run every twenty-four hours, since broken links aren't created from just your own commits, but external web pages being deleted as well.

v2.0.2 #

  • Fixed documentation for BlacklistedDirectory.

v2.0.1 #

  • Fixed bug in link parsing where plain protocols (example: just https instead of were considered links.

v2.0.0 #

  • getBadLinksInDirectory
    • Renamed {String directory} to {String path}.
    • Renamed {List<String> blacklistedFiles} to {List<String> blacklistedFilePaths}.
    • Added {List<String> blacklistedLinks}.
    • Added {List<RegExp> blacklistedLinksRegexes}.
  • getLinksInDirectory
    • Renamed {String directory} to {String path}.
    • Renamed {List<String> blacklistedFiles} to {List<String> blacklistedFilePaths}.
    • Added {List<String> blacklistedLinks}.
    • Added {List<RegExp> blacklistedLinksRegexes}.
  • getBadLinksInFile
    • Added {List<String> blacklistedLinks}.
    • Added {List<RegExp> blacklistedLinksRegexes}.
  • getLinksInFile
    • Changed return type from Stream<String> to Future<List<String>>.
    • Added {List<String> blacklistedLinks}.
    • Added {List<RegExp> blacklistedLinksRegexes}.
  • Added String parseUrl(String url).
  • Added bool isGoodStatusCode(int statusCode).
  • Improved link parsing by taking delimiters into account. For example, a file containing the link as var link = ''; will now be parsed as instead of'.

v1.1.1 #

  • Lowered the minimum SDK version from 2.0.0-dev.65.0 to 2.0.0-dev.56.0.

v1.1.0 #

  • getBadLinksInDirectory
    • Added {bool followLinks = true}.
  • BlacklistedDirectory
    • Added {bool followLinks = true} to default constructor.
  • getLinksInDirectory
    • Added {bool followLinks = true}.

v1.0.0 #

  • Released the first version.


import 'package:link_checker/link_checker.dart';
import 'package:test/test.dart';

void main() {
  test('project for dead links', () async {
    var badLinks = <BadLink>[];
    await for (BadLink badLink in getBadLinksInDirectory(blacklistedFilePaths: [
    ], blacklistedDirectories: [
    ], blacklistedLinks: [
    ])) {
    expect(badLinks, isEmpty);
  }, timeout: Timeout.none);

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  link_checker: ^2.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:link_checker/link_checker.dart';
Version Uploaded Documentation Archive
2.0.2 Jan 2, 2019 Go to the documentation of link_checker 2.0.2 Download link_checker 2.0.2 archive
2.0.1 Aug 19, 2018 Go to the documentation of link_checker 2.0.1 Download link_checker 2.0.1 archive
2.0.0 Aug 11, 2018 Go to the documentation of link_checker 2.0.0 Download link_checker 2.0.0 archive
1.1.1 Jul 28, 2018 Go to the documentation of link_checker 1.1.1 Download link_checker 1.1.1 archive
1.1.0 Jul 27, 2018 Go to the documentation of link_checker 1.1.0 Download link_checker 1.1.0 archive
1.0.0 Jul 26, 2018 Go to the documentation of link_checker 1.0.0 Download link_checker 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13


Detected platforms: Flutter, other

Primary library: package:link_checker/link_checker.dart with components: io.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.56.0 <3.0.0
markdown ^2.0.2 2.0.2
Transitive dependencies
args 1.5.1
charcode 1.1.2
Dev dependencies
test ^1.3.0