Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@quailjs/quail-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quailjs/quail-cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/config.js

29

lib/quailDevelop.js

@@ -7,10 +7,9 @@ 'use strict';

var appOpener = require('opener');
var assessmentSpecsPath = path.join(__dirname, '..', '..', 'test', 'assessmentSpecs', 'specs');
var config = require('./config');
var cwd = process.cwd();
var state = {};
/**
*
*/
function serveAssessmentTestPage(response, assessmentName) {
// Load up a page with the assessment test page.
fs.readFile(path.join(assessmentSpecsPath, assessmentName, assessmentName + '.html'), 'utf-8', function (err, source) {
fs.readFile(path.join(state.assessmentSpecsPath, assessmentName, assessmentName + '.html'), 'utf-8', function (err, source) {
if (err) {

@@ -24,5 +23,5 @@ console.error('\n' + err + '\n');

// Javascript resources.
source += '<script src="node_modules/jquery/dist/jquery.min.js" type="application/javascript"></script>';
source += '<script src="' + state.jquery + '" type="application/javascript"></script>';
source += ['<script>', 'window.assessmentName = \'' + assessmentName + '\';', '</script>'].join('\n');
source += '<script src="dist/runInBrowser.js" type="application/javascript"></script>';
source += '<script src="' + state.quail + '" type="application/javascript"></script>';

@@ -39,3 +38,3 @@ source += bodyTag + '</html>';

function serveScriptResource(response, resourcePath) {
fs.readFile(path.join(__dirname, '..', '..', resourcePath), 'utf-8', function (err, source) {
fs.readFile(path.join(cwd, resourcePath), 'utf-8', function (err, source) {
if (err) {

@@ -104,3 +103,3 @@ response.writeHead(404, {

else if (accepts.indexOf('image') > -1) {
assetPath = path.join(assessmentSpecsPath, assessmentName, url);
assetPath = path.join(state.assessmentSpecsPath, assessmentName, url);
serveAssetResource(response, assetPath);

@@ -111,2 +110,7 @@ }

serveScriptResource(response, url);
} else if (url.indexOf('.ico') > -1) {
response.writeHead(415, {
'Content-Type': 'text/html'
});
response.end('<!DOCTYPE html>\n<html><body><p>We ain\'t got none.</p></body></html>');
}

@@ -135,3 +139,8 @@ // 406

// Get a list of assessments.
fs.readdir(assessmentSpecsPath, processAssessments.bind(this, assessmentName, cmd));
config.getLocalConfig(function (data) {
state.jquery = data.jquery;
state.quail = data.quail;
state.assessmentSpecsPath = data.assessmentSpecsPath;
fs.readdir(state.assessmentSpecsPath, processAssessments.bind(this, assessmentName, cmd));
});
};
{
"name": "@quailjs/quail-cli",
"description": "The Quail command line interface",
"version": "0.0.2",
"version": "0.0.3",
"author": "Jesse Beach <jesse.r.beach@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc