This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": "altr", | |
"_rev": "13-51f35b7d481978efdd85d1e3737f4d0f", | |
"name": "altr", | |
"description": "README.md", | |
"dist-tags": { | |
"latest": "0.0.6" | |
}, | |
"versions": { | |
"0.0.0": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cls = require('continuation-local-storage') | |
, concat = require('concat-stream') | |
, http = require('http') | |
var foo = cls.createNamespace('foo') | |
http.createServer(foo.bind(function(req, res) { | |
req.pipe(concat(done)) | |
function done() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var document = require('dom-lite').document | |
, htmlparser = require('htmlparser2') | |
var el_proto = Object.getPrototypeOf(document.createElement('p')) | |
, node_proto = Object.getPrototypeOf(el_proto) | |
Object.defineProperty(el_proto, 'innerHTML', { | |
get: get_html | |
, set: set_html | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = debounce | |
function debounce(fn, delay, at_start) { | |
var timeout | |
if(typeof delay === 'undefined') { | |
delay = 0 | |
} | |
return function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tape = require('tape') | |
module.exports = setup | |
function setup(up, down, run) { | |
return function add_test(name, fn) { | |
var test_state = {} | |
var test = tape(name, function(t) { | |
test_state = up ? up(test_state) : test_state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var format = require('util').format | |
, ldap = require('ldapjs') | |
, fs = require('fs') | |
module.exports = setup | |
function setup(unpm) { | |
var base_options = { | |
url: unpm.config.ldap.uri | |
, tlsOptions: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_commas(args, change) { | |
return function(val) { | |
var regex = /(\d+)(\d{3})/ | |
val = val.toString() | |
while(regex.test(val)) { | |
val = val.replace(/(\d+)(\d{3})/, '$1,$2') | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function upload_file(file) { | |
var fd = new FormData | |
, self = this | |
fd.append('file', file) | |
var xhr = request.post(url, {}, fd, function(err, response, headers) { | |
if(err) { | |
// non 200 resonse will be an error | |
// handle error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TransfromStream = require('stream').Transform | |
module.exports = Parser | |
function Parser(row, col) { | |
TransfromStream.call(this) | |
this._writableState.objectMode = false | |
this._readableState.objectMode = true | |
this.row_delim = row || '\r\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express(); | |
var sub = express.Router() | |
var sub2 = express.Router() | |
sub2.get('/c', function(req, res, next, base) { | |
res.send('sub test!!') | |
}) |
OlderNewer