html-get 2.21.2 → 2.22.0-0
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/LICENSE +0 -0
- package/package.json +14 -17
- package/scripts/postinstall +0 -0
- package/src/auto-domains.json +1 -1
- package/src/index.js +10 -6
package/LICENSE
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "html-get",
|
|
3
3
|
"description": "Get the HTML from any website, fine-tuned for correction & speed",
|
|
4
4
|
"homepage": "https://nicedoc.com/microlinkhq/html-get",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.22.0-0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"html-get": "bin/index.js"
|
|
@@ -82,18 +82,6 @@
|
|
|
82
82
|
"scripts",
|
|
83
83
|
"src"
|
|
84
84
|
],
|
|
85
|
-
"scripts": {
|
|
86
|
-
"clean": "rm -rf node_modules",
|
|
87
|
-
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
|
|
88
|
-
"lint": "standard",
|
|
89
|
-
"postinstall": "node scripts/postinstall",
|
|
90
|
-
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
|
|
91
|
-
"pretest": "npm run lint",
|
|
92
|
-
"release": "standard-version -a",
|
|
93
|
-
"release:github": "github-generate-release",
|
|
94
|
-
"release:tags": "git push --follow-tags origin HEAD:master",
|
|
95
|
-
"test": "c8 ava"
|
|
96
|
-
},
|
|
97
85
|
"license": "MIT",
|
|
98
86
|
"ava": {
|
|
99
87
|
"files": [
|
|
@@ -122,11 +110,20 @@
|
|
|
122
110
|
"finepack"
|
|
123
111
|
]
|
|
124
112
|
},
|
|
125
|
-
"pnpm": {
|
|
126
|
-
"neverBuiltDependencies": []
|
|
127
|
-
},
|
|
128
113
|
"simple-git-hooks": {
|
|
129
114
|
"commit-msg": "npx commitlint --edit",
|
|
130
115
|
"pre-commit": "npx nano-staged"
|
|
116
|
+
},
|
|
117
|
+
"scripts": {
|
|
118
|
+
"clean": "rm -rf node_modules",
|
|
119
|
+
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
|
|
120
|
+
"lint": "standard",
|
|
121
|
+
"postinstall": "node scripts/postinstall",
|
|
122
|
+
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
|
|
123
|
+
"pretest": "npm run lint",
|
|
124
|
+
"release": "standard-version -a",
|
|
125
|
+
"release:github": "github-generate-release",
|
|
126
|
+
"release:tags": "git push --follow-tags origin HEAD:master",
|
|
127
|
+
"test": "c8 ava"
|
|
131
128
|
}
|
|
132
|
-
}
|
|
129
|
+
}
|
package/scripts/postinstall
CHANGED
|
File without changes
|
package/src/auto-domains.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[[["domainWithoutSuffix","google"]],[["domainWithoutSuffix","youtube"]],[["domainWithoutSuffix","
|
|
1
|
+
[[["domainWithoutSuffix","google"]],[["domainWithoutSuffix","youtube"]],[["domainWithoutSuffix","wordpress"]],[["domainWithoutSuffix","apple"]],[["domainWithoutSuffix","microsoft"]],[["domainWithoutSuffix","wikipedia"]],[["domainWithoutSuffix","vimeo"]],[["domainWithoutSuffix","blogspot"]],[["domainWithoutSuffix","github"]],[["domain","x.com"]],[["domainWithoutSuffix","nytimes"]],[["domainWithoutSuffix","theguardian"]],[["domainWithoutSuffix","twitter"]],[["domainWithoutSuffix","bbc"]],[["domainWithoutSuffix","imdb"]],[["domainWithoutSuffix","slideshare"]],[["domainWithoutSuffix","telegraph"]],[["domainWithoutSuffix","pinterest"]],[["domainWithoutSuffix","spotify"]],[["domainWithoutSuffix","huffingtonpost"]],[["domainWithoutSuffix","instagram"]],[["domainWithoutSuffix","techcrunch"]],[["domainWithoutSuffix","zoom"]],[["domain","abc.net.au"]],[["domainWithoutSuffix","arxiv"]],[["domainWithoutSuffix","yelp"]],[["domainWithoutSuffix","eventbrite"]],[["domainWithoutSuffix","engadget"]],[["domainWithoutSuffix","soundcloud"]],[["domainWithoutSuffix","theverge"]],[["domainWithoutSuffix","digg"]],[["domainWithoutSuffix","imgur"]],[["domainWithoutSuffix","csdn"]],[["domainWithoutSuffix","deviantart"]],[["domainWithoutSuffix","dribbble"]],[["domainWithoutSuffix","etsy"]],[["domainWithoutSuffix","flickr"]],[["domainWithoutSuffix","ghost"]],[["domainWithoutSuffix","giphy"]],[["domainWithoutSuffix","gitlab"]],[["domainWithoutSuffix","meetup"]],[["domainWithoutSuffix","producthunt"]],[["domainWithoutSuffix","reddit"]],[["domainWithoutSuffix","sourceforge"]],[["domainWithoutSuffix","stackoverflow"]],[["domainWithoutSuffix","substack"]],[["domainWithoutSuffix","tumblr"]],[["domainWithoutSuffix","ycombinator"]]]
|
package/src/index.js
CHANGED
|
@@ -139,9 +139,9 @@ const prerender = PCancelable.fn(
|
|
|
139
139
|
async (page, response) => {
|
|
140
140
|
if (!response) throw new AbortError('empty response')
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
const duration = debug.duration()
|
|
143
|
+
const payload = {
|
|
143
144
|
headers: response.headers(),
|
|
144
|
-
html: await page.content(),
|
|
145
145
|
mode: 'prerender',
|
|
146
146
|
url: response.url(),
|
|
147
147
|
statusCode: response.status(),
|
|
@@ -153,6 +153,11 @@ const prerender = PCancelable.fn(
|
|
|
153
153
|
url: req.url()
|
|
154
154
|
}))
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
duration('payload:basic')
|
|
158
|
+
payload.html = await page.content('html')
|
|
159
|
+
duration('payload:html')
|
|
160
|
+
return payload
|
|
156
161
|
},
|
|
157
162
|
{
|
|
158
163
|
timeout,
|
|
@@ -161,9 +166,10 @@ const prerender = PCancelable.fn(
|
|
|
161
166
|
}
|
|
162
167
|
)
|
|
163
168
|
|
|
169
|
+
const duration = debug.duration('prerender')
|
|
164
170
|
const payload = await getPayload(url, opts)
|
|
165
171
|
await fetchRes.cancel()
|
|
166
|
-
|
|
172
|
+
duration({ url, state: 'success' })
|
|
167
173
|
return payload
|
|
168
174
|
} catch (err) {
|
|
169
175
|
const { isRejected, ...dataProps } = await fetchRes
|
|
@@ -216,9 +222,7 @@ const defaultGetTemporalFile = (input, ext) => {
|
|
|
216
222
|
const defaultMutool = () =>
|
|
217
223
|
(() => {
|
|
218
224
|
try {
|
|
219
|
-
const mutoolPath = execSync('which mutool'
|
|
220
|
-
.toString()
|
|
221
|
-
.trim()
|
|
225
|
+
const mutoolPath = execSync('which mutool').toString().trim()
|
|
222
226
|
return (...args) => $(`${mutoolPath} draw -q -F html ${args}`)
|
|
223
227
|
} catch (_) {}
|
|
224
228
|
})()
|