Skip to content

Commit

Permalink
This commit added following new files and
Browse files Browse the repository at this point in the history
dependencies:
    *Add contributing.MD
    *add Prettier
    *add Prettier documentation to contributing.md
    *add Linter
    *add .vscode
    *add husky for pre commit
  • Loading branch information
tianlangwu committed Nov 14, 2020
1 parent d54ea96 commit 9583b6f
Show file tree
Hide file tree
Showing 16 changed files with 2,022 additions and 176 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
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": {}
}
5 changes: 5 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "npm run eslint && npm run prettier --check"
}
}
11 changes: 11 additions & 0 deletions .prettierignore
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
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2,
"bracketSpacing": false
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
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
}
}
31 changes: 31 additions & 0 deletions CONTRIBUTING.MD
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'.
25 changes: 21 additions & 4 deletions README.md
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
```

0 comments on commit 9583b6f

Please sign in to comment.