-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit added following new files and
dependencies: *Add contributing.MD *add Prettier *add Prettier documentation to contributing.md *add Linter *add .vscode *add husky for pre commit
- Loading branch information
1 parent
d54ea96
commit 9583b6f
Showing
16 changed files
with
2,022 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "npm run eslint && npm run prettier --check" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Ignore artifacts: | ||
./node_modules | ||
./test | ||
.gitignore | ||
.prettierignore | ||
LICENSE | ||
README.md | ||
CONTRIBUTING.MD | ||
.eslintignore | ||
package.json | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "all", | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"bracketSpacing": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# urlstatuschecker | ||
|
||
## Set up the Tool | ||
|
||
1. Copy and paste the link into your terminal with the command: `git clone https://github.com/hyunjiLeeTech/URL-FI.git`. | ||
2. Move your current directory to urlstatuschecker then install all the dependencies using the npm command: `npm i`. | ||
3. Make a symbolic link of the command using `npm link`. | ||
4. Enter the command along with a filename to use the tool. | ||
|
||
## Formatting using prettier | ||
|
||
Urlstatuschecker uses 'Prettier' for formatting code. | ||
|
||
run `npm run prettier` will auto fomatting all the code in project. | ||
run `npm run prettier-check` will check are all files match the Prettier code style. | ||
If you want to ignore certain files for prettier, add the file in the '.prettierignore' file. | ||
|
||
For more information about Prettier, you can visit: [prettier](https://prettier.io/) | ||
|
||
## Formatting using Linter | ||
|
||
Urlstatuschecker use 'Linter' to formatting and avoid code patterns that lead to bugs. | ||
|
||
run `npm run eslint` to check any linter problem you need to fix before commit. | ||
If you want to ignore certain files for prettier, add the file in the '.eslintignore' file. | ||
|
||
For more information about Linter, you can visit: [Linter](https://eslint.org/) | ||
|
||
## IDE Integration | ||
|
||
Prittier and Linter will automatically working when you save files. If it does not work, please check install the recommendation extentions 'Prettier' and 'linter'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,59 @@ | ||
# UrlStatusChecker | ||
|
||
UrlStatusChecker is a command-line tool written in Node.js to check all the URL's status inside your local file. | ||
The current version is 0.1. <br> | ||
If the URL is good with the status code 200, it prints "GOOD" in green. <br> | ||
If the URL is bad with the status code 400 or 404, it prints "BAD" in Red. <br> | ||
If the URL is redirect with the status code 301, 307, 308 , it prints "Redirect" in Blue. <br> | ||
If the RUL is broken or no response, it prints "Broken / No response" in White. <br> | ||
Else, it prints "UNKNOWN" in grey. | ||
|
||
# How do I install this? | ||
Run the command using | ||
|
||
Run the command using | ||
|
||
```bash | ||
npm i -g https://github.com/tianlangwu/urlStatusChecker | ||
``` | ||
|
||
Or download the files, then "run npm install -g pathName" | ||
|
||
```bash | ||
npm install -g C:\Seneca\OSD600\Release0.1 | ||
``` | ||
|
||
After downloan, yo can also "cd" to the path directory then run npm link / npm install -g<br> | ||
|
||
# How do I run it? | ||
|
||
Run the command using "urlstatuschecker Path\filename".<br> | ||
|
||
```bash | ||
urlstatuschecker C:\Seneca\OSD600\Release0.1\test1.html | ||
``` | ||
|
||
For multiple file | ||
```bash | ||
|
||
```bash | ||
urlstatuschecker C:\Seneca\OSD600\Release0.1\test1.html test3.html | ||
``` | ||
# Features | ||
|
||
# Features | ||
|
||
1. URLs printed in colors depending on their status.<br> | ||
2. Support command line args (e.g., --version). | ||
3. Won't crash when accessing a bad URL or timeouts. | ||
3. Won't crash when accessing a bad URL or timeouts. | ||
4. Allow passing multiple file paths | ||
|
||
# Available command args | ||
|
||
-v / -version: Show the Current version of urlStatusChecker.<br> | ||
-u: Check the url status directly | ||
-good: only good URLs to get displayed | ||
-bad:only bad URLs to get displayed | ||
--json/-j: output JSON file in format of [ { "url": 'https://www.google.com', "status": 200 }, { "url": 'https://bad-link.com', "status": 404 } ] | ||
-i/--ignore: allows specifying two files, first file should contain the links to be ignored if they are contained in the second file. | ||
|
||
```bash | ||
urlstatuschecker -u http://www.google.com | ||
``` |
Oops, something went wrong.