Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var sys = require('sys');
var colors = require('./colors');
sys.puts('Rainbows are fun!'.rainbow);
sys.puts('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
sys.puts('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
function testFile(test) {
var test = test.replace(".js", "");
try {
require(test);
sys.puts("PASS " + path.basename(test));
}
catch(e) {
var msg = "FAIL " + test + ": " + e;
if(e.expected != true)
msg += ", expected: " + JSON.stringify(e.expected)
+ " actual: " + JSON.stringify(e.actual);
sys.puts(msg);
}
}
HttpServer.prototype.start = function(port) {
this.port = port;
this.server.listen(port);
sys.puts('Http Server running at http://127.0.0.1:' + port + '/');
};
ent1.$save( function(err,ent1) {
sys.puts(ent1);
sys.puts('http://localhost:3000/seneca/1.0/entity/test/foo/bar/id/'+ent1.id);
var server = connect.createServer(
connect.router(seneca.router)
);
server.listen(3000);
});
});
NX.server.Daemon.kill(lockFile, function (err, pid) {
if(err) {
return sys.puts('Error stopping daemon: ' + err);
}
NX.server.Daemon.fireEvent('destroy');
sys.puts('Successfully stopped daemon with pid: ' + pid);
});
p.pprint = function(s) {
for (var i=0; i
function outputCompletion(value) {
var toOutput;
if (!value || ((value instanceof Array) && value.length === 0)) {
return;
}
if (value instanceof Array) {
toOutput = value.join(' ');
}
else {
toOutput = value;
}
sys.puts(toOutput);
}
exports.info = forLevels(['info', 'debug'], function (label, val) {
if (val === undefined) {
val = label;
label = null;
}
if (typeof val !== 'string') {
val = sys.inspect(val);
}
label ? sys.puts(magenta(label + ' ') + val): sys.puts(val);
});
response.addListener("end", function() {
if (CouchDB.debug) {
sys.puts("COMPLETED " + requestPath + " -> " + verb);
sys.puts(responseBody)
}
responseBody = JSON.parse(responseBody);
if (response.statusCode === successStatus) {
if (options.success) {
options.success(responseBody);
}
} else if (options.error) {
options.error(responseBody);
}
});
});