Skip to content

Instantly share code, notes, and snippets.

setup complete. npm loves you!
npmE is now up and running!
[root@npm1 etc]# npme start
-bash: /usr/bin/npme: No such file or directory
{ penguinfrk: 784,
piper: 720,
Chew: 710,
goonerJimmy: 673,
Chopin: 664,
Blitz: 579,
shinanai: 522,
YaoHe: 485,
sonic: 480,
yida9900: 470,
'use strict';
var child_process = require('child_process');
var Promise = require('bluebird');
module.exports = Promise.method(function spawn(command, args, cwd) {
if (!command || !cwd) {
throw new Error("Both command and working directory must be given, not " + command + " and " + cwd);
}
if (args && !args.every(function (arg) {
@myndzi
myndzi / json-loader.js
Last active August 29, 2015 14:07
Detect stream compression type and build json object on request object
//load modules
//var app = require('express')();
var http = require('http');
//var server = new http.Server();
var zlib = require('zlib');
var JsonLoader = require('./index');
var server = http.createServer(function (req, res) {
function next(err) {
var foo = new Thing(),
bar = new Thing();
foo.process(function (stream) {
return {
date: stream.splice('<div class="date">', '</div>'),
city: stream.splice('<h3 class="city">', '</h3>'),
url: stream.splice('<div class="item">', '</div>')
.match(/<a href="(.*?)">(.*?)<\/a>/)
}
1 failing
1) Integration Tests Dialect: sqlite3 Inserts should handle simple inserts:
Error
at QueryBuilder_SQLite3.Target.(anonymous function) (/home/local/DARKSIDE/kris.re/knex/lib/interface.js:9:5689)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:63:37)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
at QueryBuilder_SQLite3.qb.then (/home/local/DARKSIDE/kris.re/knex/test/integration/logger.js:71:35)
diff --git a/lib/interface.js b/lib/interface.js
index 83b5c3d..a3263fc 100644
--- a/lib/interface.js
+++ b/lib/interface.js
@@ -21,12 +21,6 @@ Target.prototype._formatQuery = function(sql, bindings, tz) {
return SqlString.format(sql, bindings, true, tz);
};
-// Create a new instance of the `Runner`, passing in the current object.
-Target.prototype.then = function(onFulfilled, onRejected) {
'use strict';
var Promise = require('bluebird');
module.exports = function (app) {
var c = app.config, log = app.log;
return Promise.promisify(app.listen)(
c.get('port'),
c.get('ip')
function Thing(socket) {
this.socket = socket;
this.socket.once('end', this.cleanup.bind(this));
this.handlers = [ ];
}
Thing.prototype.onDisconnect = function (cb) {
this.handlers.push(cb);
}
Thing.prototype.cleanup = function () {
function Thing(opts) {
opts = opts || { };
Duplex.call(this, opts);
// not object mode on write (?)
this._readableState.objectMode = true;
this.upstream = false;
this.downstream = false;