You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

48 lines
810 B

'use strict';
const Wappalyzer = require('./driver');
const args = process.argv.slice(2);
const url = args.shift() || '';
if ( !url ) {
process.stderr.write('No URL specified\n');
process.exit(1);
}
var options = {};
var arg;
while ( arg = args.shift() ) {
var matches = /--([^=]+)=(.+)/.exec(arg);
if ( matches ) {
var key = matches[1].replace(/-\w/g, matches => matches[1].toUpperCase());
var value = matches[2];
options[key] = value;
}
}
const wappalyzer = new Wappalyzer(url, options);
setTimeout(() => {
console.log('force quit');
process.exit(1);
}, 10000);
wappalyzer.analyze()
.then(json => {
process.stdout.write(JSON.stringify(json) + '\n')
process.exit(0);
})
.catch(error => {
process.stderr.write(error + '\n')
process.exit(1);
});