Skip to content

Commit f7b5c66

Browse files
committed
Fix ENOENT when running from working directory without package.json (#516)
1 parent 6c5cfc5 commit f7b5c66

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/config/defaults.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import fs from 'fs';
2-
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
3-
const defaultRequestUserAgent = `${packageJson.name}/${packageJson.version} (https://github.com/website-scraper/node-website-scraper)`;
1+
const defaultRequestUserAgent = 'website-scraper (https://github.com/website-scraper/node-website-scraper)';
42

53
const config = {
64
defaultFilename: 'index.html',

0 commit comments

Comments
 (0)