Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/princed/specht
Check links found in html or js files by pattern
https://github.com/princed/specht
cli crawler html javascript streams
Last synced: about 2 months ago
JSON representation
Check links found in html or js files by pattern
- Host: GitHub
- URL: https://github.com/princed/specht
- Owner: princed
- Created: 2016-08-24T11:18:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T01:13:11.000Z (over 3 years ago)
- Last Synced: 2024-04-14T12:08:10.144Z (9 months ago)
- Topics: cli, crawler, html, javascript, streams
- Language: JavaScript
- Size: 294 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Specht
======[![Dependency Status](https://img.shields.io/david/princed/specht.svg?style=flat-square)](https://david-dm.org/princed/specht) [![Greenkeeper badge](https://badges.greenkeeper.io/princed/specht.svg)](https://greenkeeper.io/) [![Current version](https://img.shields.io/npm/v/specht.svg?style=flat-square)](https://www.npmjs.com/package/specht) [![Travis Build Status](https://img.shields.io/travis/princed/specht.svg?style=flat-square)](https://travis-ci.org/princed/specht)
## Installation
```
$ npm install specht --save
```## Usage
### CLI
```sh
$ specht --helpUsage: specht [path] [options]
Example: specht path/to/start/from \
--pattern https://www.jetbrains.com/hub/help/1.0/%s.html \
--ignore-file .gitignore \
--html-rules svg:xlink:href hub-page-help-link:url \
--js-rules getHelpUrlFilter getHelpUrlInSecondParameter:1 \
--html-extension .html .htm \
--teamcityAt least one of --js-rules or --html-rules parameters is required. Will exit
with code 1 otherwise.Options:
--pattern Help site pattern, e.g.:
https://www.jetbrains.com/hub/help/1.0/%s.html. “%s”
placeholder is replaced with parts found by parsers
[default: "%s"]
--ignore-file Files and directories to ignore, uses .gitgnore format.
Relative from path.
--html-rules Rules of parsing HTML files, in form of :. XML namespaces for attributes are
supported. [array]
--js-rules Rules of parsing JavaScript files, in form of [:]. [array]
--html-extension Extensions of HTML files [array] [default: [".html"]]
--js-extension Extensions of JavaScript files [array] [default: [".js"]]
--teamcity Report check results to TeamCity [boolean]
--help Show help [boolean]
```### Programmatic
See fields descriptions above, however there are no defaults for programmatic usage
```js
import createRunner from 'specht';const runner = createRunner();
runner.start({
rootDir,
pattern,
ignoreFile,
teamcity,
htmlExtension,
htmlRules,
jsExtension,
jsRules
});
```