es6-crawler-detect 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/package.json +7 -1
- package/.babelrc +0 -19
- package/.github/FUNDING.yml +0 -12
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -41
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -29
- package/.mocharc.json +0 -5
- package/.prettierrc.json +0 -5
- package/CODE_OF_CONDUCT.md +0 -76
- package/eslint.config.mjs +0 -50
- package/example/node/index.html +0 -22
- package/example/node/package-lock.json +0 -715
- package/example/node/package.json +0 -12
- package/example/node/server.js +0 -38
- package/src/index.ts +0 -18
- package/src/lib/crawler/crawlers.ts +0 -1397
- package/src/lib/crawler/exclusions.ts +0 -56
- package/src/lib/crawler/headers.ts +0 -18
- package/src/lib/crawler/provider.ts +0 -3
- package/src/lib/crawler.ts +0 -128
- package/src/types.ts +0 -15
- package/test/lib/crawler.spec.ts +0 -116
- package/test/lib/database/crawlers.txt +0 -3651
- package/test/lib/database/devices.txt +0 -165636
- package/tsconfig.json +0 -28
package/README.md
CHANGED
@@ -6,7 +6,9 @@
|
|
6
6
|
</p>
|
7
7
|
|
8
8
|
[](https://deepscan.io/dashboard#view=project&tid=16465&pid=19756&bid=518343)
|
9
|
-
|
9
|
+

|
10
|
+
[](https://badge.fury.io/js/es6-crawler-detect)
|
11
|
+

|
10
12
|
[](https://github.com/JefferyHus/es6-crawler-detect/issues)
|
11
13
|
|
12
14
|
## About
|
package/package.json
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "es6-crawler-detect",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.2",
|
4
4
|
"description": "This is an ES6 adaptation of the original PHP library CrawlerDetect, this library will help you detect bots/crawlers/spiders vie the useragent.",
|
5
5
|
"main": "dist/index.js",
|
6
|
+
"type": "commonjs",
|
7
|
+
"files": [
|
8
|
+
"dist"
|
9
|
+
],
|
10
|
+
"sideEffects": false,
|
6
11
|
"directories": {
|
7
12
|
"lib": "lib"
|
8
13
|
},
|
@@ -56,6 +61,7 @@
|
|
56
61
|
"prettier": "^3.3.3",
|
57
62
|
"style-loader": "^4.0.0",
|
58
63
|
"terser-webpack-plugin": "^5.3.10",
|
64
|
+
"ts-node": "^10.9.2",
|
59
65
|
"typescript": "^5.6.2",
|
60
66
|
"webpack": "^5.94.0",
|
61
67
|
"webpack-cli": "^5.1.4",
|
package/.babelrc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"presets": [
|
3
|
-
[
|
4
|
-
"@babel/preset-env",
|
5
|
-
{
|
6
|
-
"targets": {
|
7
|
-
// The % refers to the global coverage of users from browserslist
|
8
|
-
"browsers": ["> 0.25%, not dead"]
|
9
|
-
},
|
10
|
-
"useBuiltIns": "usage",
|
11
|
-
"corejs": { "version": "3", "proposals": true }
|
12
|
-
}
|
13
|
-
]
|
14
|
-
],
|
15
|
-
"sourceType": "unambiguous",
|
16
|
-
"plugins": [
|
17
|
-
"@babel/plugin-transform-class-properties"
|
18
|
-
]
|
19
|
-
}
|
package/.github/FUNDING.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# These are supported funding model platforms
|
2
|
-
|
3
|
-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
-
patreon: jefferyhus
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
7
|
-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
11
|
-
otechie: # Replace with a single Otechie username
|
12
|
-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
@@ -1,41 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Bug report
|
3
|
-
about: Create a report to help us improve
|
4
|
-
title: ''
|
5
|
-
labels: 'bug'
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Describe the bug**
|
11
|
-
A clear and concise description of what the bug is.
|
12
|
-
|
13
|
-
**To Reproduce**
|
14
|
-
Steps to reproduce the behavior:
|
15
|
-
|
16
|
-
1. Go to '...'
|
17
|
-
2. Click on '....'
|
18
|
-
3. Scroll down to '....'
|
19
|
-
4. See error
|
20
|
-
|
21
|
-
**Expected behavior**
|
22
|
-
A clear and concise description of what you expected to happen.
|
23
|
-
|
24
|
-
**Screenshots**
|
25
|
-
If applicable, add screenshots to help explain your problem.
|
26
|
-
|
27
|
-
**Desktop (please complete the following information):**
|
28
|
-
|
29
|
-
- OS: [e.g. iOS]
|
30
|
-
- Browser [e.g. chrome, safari]
|
31
|
-
- Version [e.g. 22]
|
32
|
-
|
33
|
-
**Smartphone (please complete the following information):**
|
34
|
-
|
35
|
-
- Device: [e.g. iPhone6]
|
36
|
-
- OS: [e.g. iOS8.1]
|
37
|
-
- Browser [e.g. stock browser, safari]
|
38
|
-
- Version [e.g. 22]
|
39
|
-
|
40
|
-
**Additional context**
|
41
|
-
Add any other context about the problem here.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Feature request
|
3
|
-
about: Suggest an idea for this project
|
4
|
-
title: ''
|
5
|
-
labels: 'feature'
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Is your feature request related to a problem? Please describe.**
|
11
|
-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
-
|
13
|
-
**Describe the solution you'd like**
|
14
|
-
A clear and concise description of what you want to happen.
|
15
|
-
|
16
|
-
**Describe alternatives you've considered**
|
17
|
-
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
-
|
19
|
-
**Additional context**
|
20
|
-
Add any other context or screenshots about the feature request here.
|
@@ -1,29 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Pull request
|
3
|
-
about: Improving the existing code
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
## Description
|
11
|
-
|
12
|
-
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
13
|
-
|
14
|
-
## Summary
|
15
|
-
|
16
|
-
Please delete options that are not relevant.
|
17
|
-
|
18
|
-
- [ ] Bug fix (non-breaking change which fixes an issue)
|
19
|
-
- [ ] New feature (non-breaking change which adds functionality)
|
20
|
-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
21
|
-
- [ ] This change requires a documentation update
|
22
|
-
|
23
|
-
## Notes
|
24
|
-
|
25
|
-
- Run an example command line
|
26
|
-
|
27
|
-
## Examples
|
28
|
-
|
29
|
-
Writing examples of how to integrate the new code is helpful
|
package/.mocharc.json
DELETED
package/.prettierrc.json
DELETED
package/CODE_OF_CONDUCT.md
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
-
level of experience, education, socio-economic status, nationality, personal
|
10
|
-
appearance, race, religion, or sexual identity and orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at jefferytutorials@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
-
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
74
|
-
|
75
|
-
For answers to common questions about this code of conduct, see
|
76
|
-
https://www.contributor-covenant.org/faq
|
package/eslint.config.mjs
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
2
|
-
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
3
|
-
import tsParser from "@typescript-eslint/parser";
|
4
|
-
|
5
|
-
export default [{
|
6
|
-
ignores: [
|
7
|
-
"!**/.*",
|
8
|
-
"**/coverage/",
|
9
|
-
"**/junit/",
|
10
|
-
"**/dist/",
|
11
|
-
"**/mobiles/",
|
12
|
-
"**/node_modules/*",
|
13
|
-
],
|
14
|
-
|
15
|
-
files: ['**/*.ts', '**/*.tsx'],
|
16
|
-
|
17
|
-
plugins: {
|
18
|
-
"@typescript-eslint": typescriptEslint,
|
19
|
-
"simple-import-sort": simpleImportSort,
|
20
|
-
},
|
21
|
-
|
22
|
-
languageOptions: {
|
23
|
-
parser: tsParser,
|
24
|
-
parserOptions: {
|
25
|
-
project: "./tsconfig.json",
|
26
|
-
},
|
27
|
-
},
|
28
|
-
|
29
|
-
rules: {
|
30
|
-
"@typescript-eslint/no-restricted-types": "error",
|
31
|
-
"@typescript-eslint/no-explicit-any": "warn",
|
32
|
-
|
33
|
-
"max-len": ["warn", {
|
34
|
-
code: 80,
|
35
|
-
tabWidth: 2,
|
36
|
-
comments: 80,
|
37
|
-
ignoreComments: true,
|
38
|
-
ignoreTrailingComments: true,
|
39
|
-
ignoreUrls: true,
|
40
|
-
ignoreStrings: true,
|
41
|
-
ignoreTemplateLiterals: true,
|
42
|
-
ignoreRegExpLiterals: true,
|
43
|
-
}],
|
44
|
-
|
45
|
-
"@typescript-eslint/no-unused-vars": ["warn"],
|
46
|
-
|
47
|
-
"simple-import-sort/imports": "error",
|
48
|
-
"simple-import-sort/exports": "error",
|
49
|
-
},
|
50
|
-
}];
|
package/example/node/index.html
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
7
|
-
<title>ES6-Crawler-Detect</title>
|
8
|
-
<!-- Load the build -->
|
9
|
-
<script src="/dist/crawler.min.js"></script>
|
10
|
-
<script>
|
11
|
-
var Crawler = new Crawler.Crawler();
|
12
|
-
// test a spider expression
|
13
|
-
if (Crawler.isCrawler('isCrawler("Mozilla/5.0 (compatible; Sosospider/2.0; +http://help.soso.com/webspider.htm)")')) {
|
14
|
-
// log the matches
|
15
|
-
console.debug(Crawler.getMatches());
|
16
|
-
}
|
17
|
-
</script>
|
18
|
-
</head>
|
19
|
-
<body>
|
20
|
-
|
21
|
-
</body>
|
22
|
-
</html>
|