rosreestr_xml
Advanced tools
Comparing version 1.0.2 to 1.0.4
@@ -18,4 +18,3 @@ #!/usr/bin/env node | ||
.option('chrome', { | ||
describe: 'Chrome binary location', | ||
default: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' | ||
describe: 'Chrome binary location' | ||
}) | ||
@@ -22,0 +21,0 @@ }).help().argv; |
@@ -8,2 +8,3 @@ const puppeteer = require('puppeteer-core'); | ||
const cliProgress = require('cli-progress'); | ||
const chromeLocation = require('chrome-location'); | ||
@@ -13,4 +14,3 @@ const run = async (xmlDir = '.', opts) => { | ||
if(!files.length) { | ||
console.log(`0 XML files were found in ${resolve(xmlDir)}, try another directory`); | ||
return; | ||
throw new Error(`0 XML files were found in ${resolve(xmlDir)}, try another directory`); | ||
} | ||
@@ -32,3 +32,3 @@ const bar = new cliProgress.Bar({ | ||
const browser = await puppeteer.launch({ | ||
executablePath: opts.chrome | ||
executablePath: opts.chrome || chromeLocation | ||
}); | ||
@@ -68,2 +68,2 @@ const page = await browser.newPage(); | ||
module.exports = run; | ||
module.exports = run; |
{ | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"name": "rosreestr_xml", | ||
@@ -9,2 +9,3 @@ "description": "XML to HTML converter for Rosreestr's EGRN excerpts", | ||
"dependencies": { | ||
"chrome-location": "^1.2.1", | ||
"cli-progress": "^2.1.1", | ||
@@ -11,0 +12,0 @@ "fs-readfile-promise": "^3.0.1", |
@@ -13,4 +13,8 @@ # rosreestr_xml | ||
or just use `npx` to run without installing. | ||
This tool requires Google Chrome to be installed locally (preferably v.62 or higher). | ||
It will try its best to locate Chrome binary automatically on your system using [chrome-location](https://www.npmjs.com/package/chrome-location), but you can also pass it manually with `--chrome` flag (see examples below); | ||
## Usage | ||
@@ -20,2 +24,6 @@ | ||
#### Simple | ||
Run `rosreestr_xml` in directory with XML files. It'll output | ||
#### Advanced | ||
`rosreestr_xml path/to/folder/with/xmls dist.html --chrome /path/to/chrome/binary/chrome.exe` | ||
@@ -28,3 +36,4 @@ | ||
const htmlString = await rosreestr('/path/to/xml', {chrome: '/path/to/chrome/binary/chrome.exe'}) | ||
```` | ||
const htmlString = await rosreestr('/path/to/folder/with/xmls', {chrome: | ||
'/path/to/chrome/binary/chrome.exe'}) | ||
```` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37
579610
7
+ Addedchrome-location@^1.2.1
+ Addedchrome-location@1.2.1(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addeduserhome@1.0.0(transitive)
+ Addedwhich@1.3.1(transitive)