#The many »Talents« of JavaScript
[TOC]
##The many talents of JavaScript for generalizing Role Oriented Programming approaches like Traits and Mixins
###TL;DR / Summary
var proxyIdentCounter = 0; | |
// matches ast`anything here` | |
var IDENTIFIER_NAME = "ast"; | |
module.exports = function (babel) { | |
var babelParse = require('babel-core').parse; | |
// temporary |
composable("composites.Array_flatten", function (require, global) { | |
"use strict"; | |
var | |
environment = require("environment_extended_introspective_core"), | |
environment_introspective = environment.introspective, |
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |
#The many »Talents« of JavaScript
[TOC]
##The many talents of JavaScript for generalizing Role Oriented Programming approaches like Traits and Mixins
###TL;DR / Summary
This section describes the conventions used here to describe type signatures.
A [T]
is an array-like value (only ever used read-only in this API), i.e., one with an integer length
and whose indexed properties from 0 to length - 1
are of type T
.
A type T?
should be read as T | undefined
-- that is, an optional value that may be undefined
.
var parent = function() { | |
var spawn = require('child_process').spawn; | |
var child = spawn(process.execPath, [process.argv[1], 123]); | |
var stdout = ''; | |
var stderr = ''; | |
child.stdout.on('data', function(buf) { | |
console.log('[STR] stdout "%s"', String(buf)); | |
stdout += buf; | |
}); | |
child.stderr.on('data', function(buf) { |
Here's how this works:
git_hooks/
directory in your project, with these two files (plus other hooks if you want, written in a similar style)."npm"
to your devDependencies
in package.json
, so that the pre-commit
hook can do its magic.test
and lint
scripts to your package.json
, e.g. "scripts": {
"test": "mocha",
"lint": "jshint ./lib --show-non-errors"
// Based on: | |
// http://groups.google.com/group/nodejs-dev/browse_thread/thread/a0c23008029e5fa7 | |
process.stdin.resume(); | |
process.stdin.on('data', function (b) { | |
var s = b.toString('utf8'); | |
if (s === '\u0003') { | |
console.error('Ctrl+C'); | |
process.stdin.pause(); |