nomics-platform
Advanced tools
Comparing version 0.5.2 to 0.5.3
#!/usr/bin/env node | ||
require('../').CLI(process.argv.slice(2)) |
@@ -6,4 +6,4 @@ const url = require('url') | ||
module.exports = async function (options) { | ||
if (options.length !== 1) { | ||
return new Error('audit takes one argument: a url to and endpoint or a script file to run as an endpoint.') | ||
if (options.length < 1) { | ||
return new Error('audit requires at least one argument: a url to and endpoint or a script file to run as an endpoint.') | ||
} | ||
@@ -18,3 +18,3 @@ const endpoint = options[0] | ||
return auditCommand(endpoint) | ||
return auditCommand(endpoint, options.slice(1)) | ||
} | ||
@@ -45,6 +45,11 @@ | ||
async function auditCommand (command) { | ||
async function auditCommand (command, options) { | ||
const parts = command.split(' ') | ||
const child = spawn(parts[0], parts.slice(1)) | ||
let path = '' | ||
if (options.length > 0) { | ||
path = options[0] | ||
} | ||
child.stdout.on('data', (data) => { | ||
@@ -66,3 +71,3 @@ console.log(`server: ${data}`) | ||
} | ||
const result = await auditURL(`http://localhost:${port}`) | ||
const result = await auditURL(`http://localhost:${port}${path}`) | ||
@@ -69,0 +74,0 @@ await new Promise((resolve, reject) => { |
@@ -32,4 +32,4 @@ var audit = require('./audit') | ||
'Commands:', | ||
'\taudit [url]' | ||
'\taudit [url] [path-to-root]' | ||
].join('\n\t')) | ||
} |
{ | ||
"name": "nomics-platform", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Nomics Platform Toolkit", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
14709
376