Skip to content

Commit 8a7e06c

Browse files
authored
chore: merge pull request #14 from threeal/main
Version 0.2.0 Release
2 parents 270de2a + f936dfe commit 8a7e06c

31 files changed

+906
-174
lines changed

.github/dependabot.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
commit-message:
8+
prefix: chore

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ $ npm install --global google-rank
2121
To retrieve the rank of a website for a specific keyword, run the `google-rank` tool followed by the website URL and the search keyword:
2222

2323
```
24-
$ google-rank wikipedia.org krakatoa
24+
$ google-rank wikipedia.org --keywords krakatoa
2525
2626
Ranks for wikipedia.org website:
27-
1 krakatoa
27+
page 1 rank 1 krakatoa
2828
```
2929

3030
Multiple keywords can also be specified:
3131

3232
```
33-
$ google-rank wikipedia.org krakatoa mit 'social media'
33+
$ google-rank wikipedia.org --keywords krakatoa facebook 'social media'
3434
3535
Ranks for wikipedia.org website:
36-
1 krakatoa
37-
2 mit
38-
1 social media
36+
page 1 rank 1 krakatoa
37+
page 2 rank 2 facebook
38+
page 1 rank 1 social media
3939
```
4040

4141
If the website is not found for the specified keywords, it will output the rank as `?`:
4242

4343
```
44-
$ google-rank wikipedia.org 'best city to travel'
44+
$ google-rank wikipedia.org --keywords 'best city to travel'
4545
4646
Ranks for wikipedia.org website:
47-
? best city to travel
47+
page ? rank ? best city to travel
4848
```
4949

5050
## License

lib/google-rank.js

+42-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/google-rank.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils.d.ts

-13
This file was deleted.

lib/utils.js

-41
This file was deleted.

lib/utils.js.map

-1
This file was deleted.

lib/utils/arguments.d.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Represents the arguments and options of the program.
3+
*/
4+
export interface Arguments {
5+
/** Website name. */
6+
website: string;
7+
/** Keywords to search for. */
8+
keywords: string[];
9+
/** Maximum page to search for. */
10+
maxPage: number;
11+
}
12+
/**
13+
* Represents the arguments and options parser of the program.
14+
*/
15+
export declare class ArgumentsParser {
16+
#private;
17+
/**
18+
* Constructs a new instance of the arguments and options parser of the program.
19+
*/
20+
constructor();
21+
/**
22+
* Parses the arguments and options of the program.
23+
* @param argv - An optional array of strings representing the command-line arguments.
24+
* @returns A promise that resolves to the arguments and options.
25+
*/
26+
parse(argv?: readonly string[]): Promise<Arguments>;
27+
}

lib/utils/arguments.js

+102
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils/arguments.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils/format.d.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { GoogleWebsiteRank } from "./google";
2+
/**
3+
* Formats the rank of a keyword as a string.
4+
* @param keyword - The keyword string.
5+
* @param rank - The rank of the keyword.
6+
* @returns A formatted string. The rank will be displayed as a question mark if it is undefined.
7+
*/
8+
export declare function formatKeywordRank(keyword: string, rank?: GoogleWebsiteRank): string;

lib/utils/format.js

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils/format.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)