Permalink
Browse files

Remove node modules from the repo

  • Loading branch information...
1 parent 2e4df6f commit 5dd3d80f453fe25d6b52d955338dcec86811286e @cianclarke committed Feb 8, 2014
@@ -1,89 +0,0 @@
-/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
-(function () {
- "use strict";
-
- // "FIFO" isn't easy to convert to camelCase and back reliably
- var isFnodeTypes = [
- "isFile", "isDirectory", "isSymbolicLink", "isBlockDevice", "isCharacterDevice", "isFIFO", "isSocket"
- ],
- fnodeTypes = [
- "file", "directory", "symbolicLink", "blockDevice", "characterDevice", "FIFO", "socket"
- ],
- fnodeTypesPlural = [
- "files", "directories", "symbolicLinks", "blockDevices", "characterDevices", "FIFOs", "sockets"
- ];
-
-
- //
- function createNodeGroups() {
- var nodeGroups = {};
- fnodeTypesPlural.concat("nodes", "errors").forEach(function (fnodeTypePlural) {
- nodeGroups[fnodeTypePlural] = [];
- });
- return nodeGroups;
- }
-
-
- // Determine each file node's type
- //
- function sortFnodesByType(stat, fnodes) {
- var i, isType;
-
- for (i = 0; i < isFnodeTypes.length; i += 1) {
- isType = isFnodeTypes[i];
- if (stat[isType]()) {
- stat.type = fnodeTypes[i];
- fnodes[fnodeTypesPlural[i]].push(stat);
- return;
- }
- }
- }
-
-
- // Get the current number of listeners (which may change)
- // Emit events to each listener
- // Wait for all listeners to `next()` before continueing
- // (in theory this may avoid disk thrashing)
- function emitSingleEvents(emitter, path, stats, next, self) {
- var num = 1 + emitter.listeners(stats.type).length + emitter.listeners("node").length;
-
- function nextWhenReady() {
- num -= 1;
- if (0 === num) { next.call(self); }
- }
-
- emitter.emit(stats.type, path, stats, nextWhenReady);
- emitter.emit("node", path, stats, nextWhenReady);
- nextWhenReady();
- }
-
-
- // Since the risk for disk thrashing among anything
- // other than files is relatively low, all types are
- // emitted at once, but all must complete before advancing
- function emitPluralEvents(emitter, path, nodes, next, self) {
- var num = 1;
-
- function nextWhenReady() {
- num -= 1;
- if (0 === num) { next.call(self); }
- }
-
- fnodeTypesPlural.concat(["nodes", "errors"]).forEach(function (fnodeType) {
- if (0 === nodes[fnodeType].length) { return; }
- num += emitter.listeners(fnodeType).length;
- emitter.emit(fnodeType, path, nodes[fnodeType], nextWhenReady);
- });
- nextWhenReady();
- }
-
- module.exports = {
- emitNodeType: emitSingleEvents,
- emitNodeTypeGroups: emitPluralEvents,
- isFnodeTypes: isFnodeTypes,
- fnodeTypes: fnodeTypes,
- fnodeTypesPlural: fnodeTypesPlural,
- sortFnodesByType: sortFnodesByType,
- createNodeGroups: createNodeGroups
- };
-}());
@@ -1,46 +0,0 @@
-Array.forEachAsync()
-----
-
-Another reincarnation of `sequence` that makes sense for the use case of arrays.
-
-**Example:**
-
- var forEachAsync = require('forEachAsync')
- , count = 0
- , timers = [
- 101,
- 502,
- 203,
- 604,
- 105
- ];
-
- function hello(next, time) {
- this[count] = time;
-
- if (count >= 4) {
- next(forEachAsync.BREAK);
- }
-
- console.log(count += 1, time);
-
- setTimeout(next, time);
- }
-
- function goodbye() {
- console.log("All Done", this);
- }
-
- forEachAsync(timers, hello, {}).then(goodbye);
-
-API
----
-
- * forEachAsync(array, callback*[, thisArg]*)
- * forEachAsync#then(finalCallback)
- * forEachAsync#BREAK
-
-**Warning:** [Poorly written code](https://gist.github.com/941362) may have really strange errors when `Array.prototype` is extended.
-If you run into such problems please contact the author of the code (I'm also willing to help if they are unavailable).
-Libraries such as `jQuery` or `MooTools` will accept bug reports for such failures.
-
@@ -1,37 +0,0 @@
-/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
-(function () {
- "use strict";
-
- var Sequence = require('sequence');
-
- function handleItem(item, i, arr) {
- var seq = this
- ;
-
- function nextItem(next, BREAK) {
- if (forEachAsync.BREAK === BREAK) {
- process.nextTick(function () {
- next(forEachAsync.BREAK);
- });
- return;
- }
-
- seq._contextCallback.call(this, next, item, i, arr);
- }
-
- seq.then(nextItem);
- }
-
- function forEachAsync(arr, callback, _context) {
- var sequence = Sequence.create(_context);
-
- sequence._contextCallback = callback;
-
- arr.forEach(handleItem, sequence);
-
- return sequence;
- }
-
- forEachAsync.BREAK = '__forEachAsync_BREAK__';
- module.exports = forEachAsync;
-}());
@@ -1,35 +0,0 @@
-sequence()
-----
-
-Creates an Asynchronous Stack which execute each enqueued method after the previous function calls the provided `next(err, data [, ...])`.
-
-**Core**
-
- * `Futures.sequence(globalContext=null)`
- * `then(next, err, data [, ...])` - add a method onto the queue
- * begins or resumes the queue
- * passes the results of the previous function into the next
-
-**Example:**
-
- var sequence = Futures.sequence(),
- err;
-
- sequence
- .then(function (next) {
- setTimeout(function () {
- next(err, "Hi", "World!");
- }, 120);
- })
- .then(function (next, err, a, b) {
- setTimeout(function () {
- next(err, "Hello", b);
- }, 270);
- })
- .then(function (next, err, a, b) {
- setTimeout(function () {
- console.log(a, b);
- next();
- }, 50);
- });
-
@@ -1,22 +0,0 @@
-{
- "name": "sequence",
- "version": "2.2.1",
- "description": "The sequence module of FuturesJS (Ender.JS and Node.JS)",
- "homepage": "https://github.com/coolaj86/futures",
- "keywords": ["flow-control", "async", "asynchronous", "futures", "sequence", "chain", "step", "util", "browser"],
- "repository": {
- "type": "git",
- "url": "git://github.com/coolaj86/futures.git"
- },
- "author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
- "main": "sequence.js",
- "directories": {
- "lib": "."
- },
- "dependencies": {
- },
- "engines": {
- "node": "*",
- "ender": ">= 0.5.0"
- }
-}
@@ -1,66 +0,0 @@
-(function () {
- "use strict";
-
- function isSequence(obj) {
- return obj instanceof Sequence;
- }
-
- function Sequence(global_context) {
- var self = this,
- waiting = true,
- data,
- stack = [];
-
- if (!isSequence(this)) {
- return new Sequence(global_context);
- }
-
- global_context = global_context || null;
-
- function next() {
- var args = Array.prototype.slice.call(arguments),
- seq = stack.shift(); // BUG this will eventually leak
-
- data = arguments;
-
- if (!seq) {
- // the chain has ended (for now)
- waiting = true;
- return;
- }
-
- args.unshift(next);
- seq.callback.apply(seq.context, args);
- }
-
- function then(callback, context) {
- if ('function' !== typeof callback) {
- throw new Error("`Sequence().then(callback [context])` requires that `callback` be a function and that `context` be `null`, an object, or a function");
- }
- stack.push({
- callback: callback,
- context: (null === context ? null : context || global_context),
- index: stack.length
- });
-
- // if the chain has stopped, start it back up
- if (waiting) {
- waiting = false;
- next.apply(null, data);
- }
-
- return self;
- }
-
- self.next = next;
- self.then = then;
- }
-
- function createSequence(context) {
- // TODO use prototype instead of new
- return (new Sequence(context));
- }
- Sequence.create = createSequence;
- Sequence.isSequence = isSequence;
- module.exports = Sequence;
-}());
@@ -1,23 +0,0 @@
-{
- "name": "forEachAsync",
- "version": "2.2.0",
- "description": "The forEachAsync module of FuturesJS (Ender.JS and Node.JS)",
- "homepage": "https://github.com/coolaj86/futures",
- "keywords": ["flow-control", "async", "asynchronous", "futures", "forEachAsync", "chain", "step", "util", "browser"],
- "repository": {
- "type": "git",
- "url": "git://github.com/coolaj86/futures.git"
- },
- "author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
- "main": "forEachAsync.js",
- "directories": {
- "lib": "."
- },
- "dependencies": {
- "sequence": ">= 2.2.1"
- },
- "engines": {
- "node": "*",
- "ender": ">= 0.5.0"
- }
-}
@@ -1,24 +0,0 @@
-{
- "name" : "walk",
- "description" : "A node port of python's os.walk",
- "url" : "github.com/coolaj86/node-walk",
- "keywords" : ["util", "os", "sys", "fs", "walk", "walkSync"],
- "author" : "AJ ONeal <coolaj86@gmail.com>",
- "contributors" : [],
- "dependencies" : {
- "forEachAsync": "~2.2"
- },
- "lib" : ".",
- "main" : "./walk.js",
- "version" : "2.2.1",
- "licenses": [
- {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/mit-license.php"
- },
- {
- "type": "Apache2",
- "url": "http://opensource.org/licenses/apache2.0.php"
- }
- ]
-}
Oops, something went wrong.

0 comments on commit 5dd3d80

Please sign in to comment.