EventEmitter without a base class or string event names. Supports adding, removing, and one-shot listeners.
var listeners = require('listeners')
var onEvent = listeners()| /** | |
| * Create a proxy object with the given prototype that caches all method calls to be applied to a target later. | |
| * | |
| * Example of proxying an asynchronously obtained Result object | |
| * | |
| * function Client (transport) { | |
| * this._transport = transport; | |
| * } | |
| * | |
| * Client.prototype.query = function (query) { |
| var inherits = require('inherits'); | |
| inherits(CustomError, Error); | |
| function CustomError () { | |
| this.constructor.super_.apply(this, arguments); | |
| this.name = this.constructor.name; | |
| if (Error.captureStackTrace) { | |
| Error.captureStackTrace(this, this.constructor); | |
| } | |
| } |
| 'use strict'; | |
| var buster = require('buster'); | |
| var testApi = require('./test-http'); | |
| function exampleApp () { | |
| return function (req, res) { | |
| res.setHeader('content-type', 'text/plain'); | |
| res.setHeader('content-length', req.url.length); | |
| res.end(req.url); |
| --- macosx/graphviz.xcodeproj/project.pbxproj.orig 2012-08-13 15:14:54.000000000 -0500 | |
| +++ macosx/graphviz.xcodeproj/project.pbxproj 2012-08-14 13:59:30.000000000 -0500 | |
| @@ -380,12 +380,10 @@ | |
| INFOPLIST_FILE = Info.plist; | |
| INSTALL_PATH = "$(HOME)/Applications"; | |
| LIBRARY_SEARCH_PATHS = ( | |
| - ../lib/cdt/.libs, | |
| - ../lib/cgraph/.libs, | |
| - ../lib/gvc/.libs, | |
| + "$(PREFIX)/lib", |
| macro yield! { | |
| rule { $func ( $args (,) ... ) } => { | |
| yield function (cb) { | |
| $func($args (,) ..., cb) | |
| } | |
| } | |
| } |
| macro thread { | |
| case { $name ($args (,) ...) { $body ... } } => { | |
| var result = makeIdent('$_', #{$name}) | |
| return withSyntax($$_ = [result]) { | |
| console.log('here') | |
| return #{ | |
| (function () { | |
| var $$_ = arguments.length > 1 ? [].slice.call(arguments) : arguments[0]; | |
| thread_body $$_ $body ...; | |
| return $$_ |
| curl -v https://registry.npmjs.org/batch/-/batch-0.5.0.tgz > /dev/null | |
| * About to connect() to registry.npmjs.org port 443 (#0) | |
| * Trying 199.27.77.162... | |
| % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed | |
| 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* connected | |
| * Connected to registry.npmjs.org (199.27.77.162) port 443 (#0) | |
| * SSLv3, TLS handshake, Client hello (1): | |
| } [data not shown] | |
| * SSLv3, TLS handshake, Server hello (2): |
I have some code that uses concat-stream here. It's collecting some javascript from the README and evaling it. The eval currently fails with a syntax error when I use covert test.js, but not when I use node test.js.
covert pipes test.js through browserify and into node. There's some other stuff in between for the actual coverage collection but it's not relevant for this discussion. So we'll simplify things to this:
$ browserify test.js | node
TAP version 13
# README examples
[stdin]:3069
| $ lein cljsbuild clean && lein cljsbuild once | |
| Deleting files generated by lein-cljsbuild. | |
| Compiling ClojureScript. | |
| Compiling "client.js" from ["src/cljs"]... | |
| WARNING: No such namespace: core at line 524 resources/js/cljs/core/async.cljs | |
| WARNING: No such namespace: java.util.Arrays at line 675 resources/js/cljs/core/async.cljs | |
| Successfully compiled "client.js" in 39.640165 seconds. |