2.4.1 • Published 10 days ago

link-inspector v2.4.1

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
github
Last release
10 days ago

npm version Total Downloads

API

linkInspector(arg, callback)

The arg can be a link, file path, or directory path. The callback will be given the broken link and path of the link.

Examples

import linkInspector from 'link-inspector';

linkInspector('http://example.com', function (link) {
   console.log(`Broken link found: ${link}`);
});

If you want to use linkInspector on all the files in a directory:

import linkInspector from 'link-inspector';

linkInspector('./path/to/directory', function (link, path, lineNumber) {
   console.log(`Broken link ${link} found in ${path} on line ${lineNumber}`);
});

Command Line Interface

There is also a cli. You can install it with:

npm install link-inspector -g

You can use it on a links, file paths, or directory paths.

npx link-inspector ./path/to/directory

The cli tool will write the link in an output folder.

output/
│
├── subfolder/
│   ├── file1.txt
│   └── file2.txt
│
├── file3.txt
└── file4.txt

Development

  1. Clone

    git clone https://github.com/justindhillon/link-inspector.git
    cd link-inspector
  2. Install Dependencies

    npm install
  3. Build the npm package

    npm run build
  4. Run the npm package

    npx link-inspector <file/directory path>
  5. Testing the npm package

    npm run test

License

link-inspector uses the AGPL-3.0 license.

2.4.1

10 days ago

2.4.0

26 days ago

2.3.2

1 month ago

2.3.1

1 month ago

2.3.0

2 months ago

2.2.2

2 months ago

2.2.1

2 months ago

2.2.0

2 months ago

2.1.3

2 months ago

2.1.1

3 months ago

2.1.0

3 months ago

2.0.3

3 months ago

2.0.2

3 months ago

2.0.1

3 months ago

1.4.3

4 months ago

1.4.2

4 months ago

1.4.0

5 months ago

1.3.0

5 months ago

1.2.4

5 months ago

1.1.1

5 months ago

1.1.0

6 months ago

1.2.1

5 months ago

1.1.2

5 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.0

6 months ago