Compare commits

...

18 Commits

Author SHA1 Message Date
b1eeb3563e 0.1.0 2016-05-15 03:18:19 +02:00
1714f552ac now has working taskchain 2016-05-15 03:16:50 +02:00
454a999a42 improve options handling between classes 2016-05-14 23:24:11 +02:00
1f3f2ae92f included ora and introduced taskspace. 2016-05-14 04:28:22 +02:00
9014eec9f6 tiny fix 2016-05-13 05:14:29 +02:00
ee56b6f655 now has working task class 2016-05-06 02:05:45 +02:00
55ddbece13 update tests 2016-05-05 19:30:24 +02:00
130c4177a6 0.0.5 2016-05-05 19:26:02 +02:00
90c9f23c23 improved .npmignore 2016-05-05 19:25:59 +02:00
0d0ee67ca3 compiled 2016-05-05 19:21:50 +02:00
5fd11ec9c0 add some more buffer logic 2016-05-05 19:21:01 +02:00
569cb311c9 compile and update some imports to work with TypeScript declaration 2016-05-05 18:36:31 +02:00
44db37574c now running Tasks and handling task loops allright. 2016-05-05 18:06:04 +02:00
fb7f5c5e68 recompile 2016-05-04 05:20:51 +02:00
b6595ac1d3 small typo fix 2016-05-04 05:15:05 +02:00
3f3f9c68f1 small update on promise return in README 2016-05-04 05:13:36 +02:00
48c20c081f update README on how buffered Tasks work. 2016-05-04 05:11:08 +02:00
72504d7ad7 cleanup 2016-05-04 04:42:47 +02:00
27 changed files with 549 additions and 156 deletions

View File

@ -2,3 +2,4 @@
docs/
coverage/
ts/
node_modules/

View File

@ -14,10 +14,17 @@ npm install taskbuffer --save
#### Task
* A Task in its most simple form is a function that is executed when the task runs.
* It can have a preTaska and an afterTask (those are run before or after the main function whenever the task is called)
* A Task can be buffered. That means it can be called multiple times in a very short time. However execution happens in line: meaning execution of the task's main function is on halt until the previous task call has finished.
* Task.trigger() and Task.triggerBuffered() always return a Promise;
* Task.triggered() is an ObservableStram that emits events every time a task is promised.
* A Task can have a **preTask** and an **afterTask**
(those are run before or after the main function whenever the task is called)
* A Task can be buffered.
That means it can be called multiple times in a very short time.
However execution happens in line:
meaning execution of the task's main function is on halt until the previous task call has finished.
You can set bufferMax number, which is the max number of buffered task calls.
Any additional calls will then be truncated
* Task.trigger() and Task.triggerBuffered() always return a Promise
which is fullfilled once the related task call has completed.
* Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
* Task is compatible to gulp streams.
#### Taskchain

1
dist/index.d.ts vendored
View File

@ -1 +1,2 @@
export * from "./taskbuffer.classes";
import "./taskbuffer.classes.helpers";

4
dist/index.js vendored
View File

@ -4,5 +4,7 @@ function __export(m) {
}
/// <reference path="./typings/main.d.ts" />
__export(require("./taskbuffer.classes"));
// import for naming only
require("./taskbuffer.classes.helpers");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSw0Q0FBNEM7QUFDNUMsaUJBQWMsc0JBQXNCLENBQUMsRUFBRCIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiIl19
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSw0Q0FBNEM7QUFDNUMsaUJBQWMsc0JBQXNCLENBQUMsRUFBQTtBQUVyQyx5QkFBeUI7QUFDekIsUUFBTyw4QkFBOEIsQ0FBQyxDQUFEIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxyXG5leHBvcnQgKiBmcm9tIFwiLi90YXNrYnVmZmVyLmNsYXNzZXNcIjtcclxuXHJcbi8vIGltcG9ydCBmb3IgbmFtaW5nIG9ubHlcclxuaW1wb3J0IFwiLi90YXNrYnVmZmVyLmNsYXNzZXMuaGVscGVyc1wiIl19

View File

@ -1,3 +1,9 @@
export declare var emptyTaskFunction: () => any;
export declare var isTask: (taskArg: any) => boolean;
export declare var runTask: (taskArg: any) => any;
import { Task } from "./taskbuffer.classes";
export declare let emptyTaskFunction: () => any;
export declare let isTask: (taskArg: any) => boolean;
export declare let isTaskTouched: (taskArg: Task, touchedTasksArray: Task[]) => boolean;
export declare let runTask: (taskArg: Task, optionsArg?: {
touchedTasksArray: Task[];
}) => any;
export declare let runBufferedTask: (taskArg: Task) => void;
export declare let updateTaskStatus: (taskArg: any, statusArg: string) => void;

File diff suppressed because one or more lines are too long

View File

@ -5,4 +5,4 @@ function __export(m) {
__export(require("./taskbuffer.classes.task"));
__export(require("./taskbuffer.classes.taskchain"));
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsaUJBQWMsMkJBQ2QsQ0FBQyxFQUR3QztBQUN6QyxpQkFBYyxnQ0FDZCxDQUFDLEVBRDZDIiwiZmlsZSI6InRhc2tidWZmZXIuY2xhc3Nlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrXCJcbmV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW5cIlxuIl19
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsaUJBQWMsMkJBQ2QsQ0FBQyxFQUR3QztBQUN6QyxpQkFBYyxnQ0FDZCxDQUFDLEVBRDZDIiwiZmlsZSI6InRhc2tidWZmZXIuY2xhc3Nlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrXCJcclxuZXhwb3J0ICogZnJvbSBcIi4vdGFza2J1ZmZlci5jbGFzc2VzLnRhc2tjaGFpblwiXHJcbiJdfQ==

View File

@ -1,19 +1,25 @@
export declare class Task {
name: string;
task: any;
idle: boolean;
running: boolean;
idle: boolean;
buffered: boolean;
private _counterBufferRelative;
bufferCounter: number;
bufferMax: number;
private _counterTriggerAbsolute;
private _state;
preTask: Task;
afterTask: Task;
constructor(taskArg: any, optionsArg?: {
constructor(optionsArg: {
taskFunction: any;
preTask?: Task;
afterTask?: Task;
buffered?: boolean;
bufferMax?: number;
name?: string;
});
trigger(): any;
triggerBuffered(): void;
triggerUnBuffered(): any;
triggerBuffered(): any;
state: string;
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,14 @@
import * as classes from "./taskbuffer.classes";
export declare class Taskchain extends classes.Task {
constructor(taskArrayArg: classes.Task[]);
import { Task } from "./taskbuffer.classes";
export declare class Taskchain extends Task {
taskArray: Task[];
private _oraObject;
constructor(optionsArg: {
name?: string;
log?: boolean;
taskArray: Task[];
});
addTask(taskArg: Task): void;
removeTask(taskArg: Task): void;
shiftTask(): void;
trigger(): any;
}

File diff suppressed because one or more lines are too long

View File

3
dist/taskbuffer.classes.taskspace.js vendored Normal file
View File

@ -0,0 +1,3 @@
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJ0YXNrYnVmZmVyLmNsYXNzZXMudGFza3NwYWNlLmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ==

View File

@ -1,5 +1,3 @@
declare var plugins: {
beautylog: any;
Q: any;
};
export = plugins;
export import beautylog = require("beautylog");
export declare let Q: any;
export declare let lodash: any;

View File

@ -1,9 +1,7 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
Q: require("q")
};
module.exports = plugins;
exports.beautylog = require("beautylog");
exports.Q = require("q");
exports.lodash = require("lodash");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQUksT0FBTyxHQUFHO0lBQ1YsU0FBUyxFQUFFLE9BQU8sQ0FBQyxXQUFXLENBQUM7SUFDL0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUM7Q0FDbEIsQ0FBQztBQUNGLGlCQUFTLE9BQU8sQ0FBQyIsImZpbGUiOiJ0YXNrYnVmZmVyLnBsdWdpbnMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgcGx1Z2lucyA9IHtcbiAgICBiZWF1dHlsb2c6IHJlcXVpcmUoXCJiZWF1dHlsb2dcIiksXG4gICAgUTogcmVxdWlyZShcInFcIilcbn07XG5leHBvcnQgPSBwbHVnaW5zO1xuIl19
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzlCLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDcEMsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixjQUFNLEdBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDIiwiZmlsZSI6InRhc2tidWZmZXIucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cclxuZXhwb3J0IGltcG9ydCBiZWF1dHlsb2cgPSByZXF1aXJlKFwiYmVhdXR5bG9nXCIpO1xyXG5leHBvcnQgbGV0IFEgPSByZXF1aXJlKFwicVwiKTtcclxuZXhwb3J0IGxldCBsb2Rhc2g9IHJlcXVpcmUoXCJsb2Rhc2hcIik7XHJcbiJdfQ==

View File

@ -1,22 +0,0 @@
0 info it worked if it ends with ok
1 verbose cli [ '/Users/philkunz/.nvm/versions/node/v4.2.4/bin/node',
1 verbose cli '/Users/philkunz/.nvm/versions/node/v4.2.4/bin/npm',
1 verbose cli 'version',
1 verbose cli 'patch' ]
2 info using npm@3.8.5
3 info using node@v4.2.4
4 error version No valid package.json found
5 verbose stack SyntaxError: Unexpected token }
5 verbose stack at Object.parse (native)
5 verbose stack at /Users/philkunz/.nvm/versions/node/v4.2.4/lib/node_modules/npm/lib/version.js:113:19
5 verbose stack at /Users/philkunz/.nvm/versions/node/v4.2.4/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
5 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
6 verbose cwd /Users/philkunz/github/pushrocks/taskbuffer
7 error Darwin 15.4.0
8 error argv "/Users/philkunz/.nvm/versions/node/v4.2.4/bin/node" "/Users/philkunz/.nvm/versions/node/v4.2.4/bin/npm" "version" "patch"
9 error node v4.2.4
10 error npm v3.8.5
11 error Unexpected token }
12 error If you need help, you may report this error at:
12 error <https://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]

View File

@ -1,6 +1,6 @@
{
"name": "taskbuffer",
"version": "0.0.4",
"version": "0.1.0",
"description": "manage triggers and execution of tasks with promises",
"main": "dist/index.js",
"scripts": {
@ -23,7 +23,8 @@
},
"homepage": "https://github.com/pushrocks/taskbuffer#readme",
"dependencies": {
"beautylog": "^4.1.6",
"beautylog": "^5.0.0",
"lodash": "^4.12.0",
"projectinfo": "1.0.1",
"q": "^1.4.1",
"rx": "^4.1.0"

3
test/test.d.ts vendored
View File

@ -1,3 +0,0 @@
declare var taskbuffer: any;
declare var classes: any;
declare var should: any;

File diff suppressed because one or more lines are too long

View File

@ -1,25 +1,84 @@
/// <reference path="../ts/typings/main.d.ts" />
var taskbuffer = require("../dist/index");
var classes = require("../dist/taskbuffer.classes");
var should = require("should");
describe("taskbuffer",function(){
describe(".task()",function(){
var testTask;
it("should return a new task to var testTask",function(){
testTask = taskbuffer.task();
});
import taskbuffer = require("../dist/index");
let should = require("should");
let plugins = {
q: require("q")
}
it("testTask should be instance of Task",function(){
testTask.should.be.instanceof(classes.Task);
// setup some testData to work with
let testTask:taskbuffer.Task;
let testTaskFunction = function(){
let done = plugins.q.defer();
console.log("main function executed!")
done.resolve();
return done.promise;
}
let testPreTask = new taskbuffer.Task({
taskFunction:function(){
console.log("preTask executed");
},
preTask:testTask
});
describe("taskbuffer",function(){
describe(".Task",function(){
it("new Task() should return a new task",function(){
testTask = new taskbuffer.Task({taskFunction:testTaskFunction,preTask:testPreTask});
});
it("testTask should be and instance of Task",function(){
testTask.should.be.instanceof(taskbuffer.Task);
});
it("testTask.idle is true",function(){
if (!testTask.idle){
throw new Error("testTask.idle is not true");
}
});
it("testTask.running is type boolean and initially false",function(){
testTask.running.should.be.type("boolean");
testTask.running.should.be.false();
});
it("testTask.trigger() should return Promise",function(){
testTask.trigger().should.be.Promise();
});
it("testTask.trigger() returned Promise should be fullfilled",function(done){
testTask.trigger()
.then(done);
});
it("should run a task without pre and afterTask",function(done){
let localTestTask = new taskbuffer.Task({taskFunction:testTaskFunction});
localTestTask.trigger().then(done);
});
});
describe("Taskchain",function(){
let testTaskchain;
let testTaskArray = [
new taskbuffer.Task({
name:"task1",
taskFunction:function(){
let done = plugins.q.defer();
console.log("Task1 run");
done.resolve();
return done.promise;
}
}),
new taskbuffer.Task({
name:"task2",
taskFunction: function(){
let done = plugins.q.defer();
console.log("Task2 run");
done.resolve();
return done.promise;
}
}),
];
it("should run tasks in sequence",function(done){
testTaskchain = new taskbuffer.Taskchain({
name:"Taskchain1",
taskArray:testTaskArray
});
testTaskchain.trigger().then(done);
});
});
});

View File

@ -1,2 +1,5 @@
/// <reference path="./typings/main.d.ts" />
export * from "./taskbuffer.classes"
export * from "./taskbuffer.classes";
// import for naming only
import "./taskbuffer.classes.helpers"

View File

@ -1,16 +1,16 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./taskbuffer.plugins");
import classes = require("./taskbuffer.classes");
import {Task} from "./taskbuffer.classes"
export var emptyTaskFunction = function(){
var done = plugins.Q.defer();
export let emptyTaskFunction = function(){
let done = plugins.Q.defer();
done.resolve();
return done.promise;
};
export var isTask = function(taskArg):boolean{
export let isTask = function(taskArg):boolean{
if(
taskArg instanceof classes.Task
taskArg instanceof Task
&& typeof taskArg.task === "function"
){
return true;
@ -19,11 +19,79 @@ export var isTask = function(taskArg):boolean{
}
};
export var runTask = function(taskArg){
var done = plugins.Q.defer();
var taskReturn;
if(isTask(taskArg)){
taskReturn = taskArg.task();
export let isTaskTouched = (taskArg:Task, touchedTasksArray:Task[]):boolean => {
let result = false;
for (let keyArg in touchedTasksArray){
if(taskArg === touchedTasksArray[keyArg]){
result = true;
}
}
return result;
}
export let runTask = function(taskArg:Task,optionsArg:{touchedTasksArray:Task[]} = {touchedTasksArray:[]}){
let done = plugins.Q.defer();
updateTaskStatus(taskArg,"running");
done.promise.then(function(){updateTaskStatus(taskArg,"idle")})
let localDeferred = plugins.Q.defer();
let touchedTasksArray:Task[];
if(optionsArg.touchedTasksArray){
touchedTasksArray = optionsArg.touchedTasksArray;
} else {
touchedTasksArray = [];
}
touchedTasksArray.push(taskArg);
localDeferred.promise
.then(() =>{
if(taskArg.preTask && !isTaskTouched(taskArg.preTask,touchedTasksArray)){
return runTask(taskArg.preTask,{touchedTasksArray:touchedTasksArray})
} else {
let done2 = plugins.Q.defer();
done2.resolve();
return done2.promise;
}
})
.then(() => {
return taskArg.task();
})
.then(() => {
if(taskArg.afterTask && !isTaskTouched(taskArg.afterTask,touchedTasksArray)){
return runTask(taskArg.afterTask,{touchedTasksArray:touchedTasksArray})
} else {
let done2 = plugins.Q.defer();
done2.resolve();
return done2.promise;
}
})
.then(() => {
done.resolve();
});
localDeferred.resolve();
return done.promise;
};
};
export let runBufferedTask = (taskArg:Task) => {
let recursiveBufferRunner = () => {
if(taskArg.bufferCounter > 0){
taskArg.bufferCounter--;
runTask(taskArg)
.then(recursiveBufferRunner);
}
}
}
export let updateTaskStatus = (taskArg,statusArg:string) => {
switch (statusArg) {
case "running":
taskArg.running = true;
taskArg.idle = false;
break;
case "idle":
taskArg.running = false;
taskArg.idle = true;
break;
default:
throw new Error("status not recognised");
}
}

View File

@ -3,45 +3,60 @@ import * as plugins from "./taskbuffer.plugins"
import * as helpers from "./taskbuffer.classes.helpers"
export class Task {
name:string;
task:any;
idle:boolean;
running:boolean;
idle:boolean;
buffered:boolean;
private _counterBufferRelative;
private _counterTriggerAbsolute;
bufferCounter:number;
bufferMax:number;
private _counterTriggerAbsolute:number;
private _state:string;
preTask:Task;
afterTask:Task;
constructor(taskArg,optionsArg:{preTask?:Task,afterTask?:Task, buffered?:boolean} = {}){
constructor(optionsArg:{
taskFunction:any,
preTask?:Task,
afterTask?:Task,
buffered?:boolean,
bufferMax?:number,
name?:string
}){
if (!optionsArg){optionsArg = {taskFunction:function(){}}}
var options = optionsArg;
this.task = taskArg;
this.task = optionsArg.taskFunction;
this.preTask = options.preTask;
this.afterTask = options.afterTask;
this.idle = true;
this.running = false;
if (typeof options.buffered === "boolean"){
this.buffered = options.buffered;
} else {
this.buffered = false;
}
this.idle = true;
this.buffered = options.buffered;
this.bufferMax = options.bufferMax;
this.name = options.name;
}
trigger(){
let done = plugins.Q.defer();
helpers.runTask(this.preTask)
.then(function(){
})
.then(function(){
})
.then(function(){
done.resolve();
});
return done.promise;
if(this.buffered) {
this.triggerBuffered()
.then(done.resolve);
}
else {
this.triggerUnBuffered()
.then(done.resolve);
};
return done.promise;
};
triggerUnBuffered(){
return helpers.runTask(this);
}
triggerBuffered(){
var done = plugins.Q.defer();
if(!(this.bufferCounter >= this.bufferMax)){
this.bufferCounter++
}
helpers.runBufferedTask(this);
return done.promise;
}
get state():string {
@ -51,7 +66,7 @@ export class Task {
if (stateArg == "locked"){
this._state = "locked";
} else {
plugins.beautylog.error("state type" );
plugins.beautylog.error("state type " + stateArg.blue + " could not be set");
}
}
}

View File

@ -1,11 +1,68 @@
/// <reference path="./typings/main.d.ts" />
import * as plugins from "./taskbuffer.plugins";
import {Task} from "./taskbuffer.classes";
import helpers = require("./taskbuffer.classes.helpers");
import * as classes from "./taskbuffer.classes"
export class Taskchain extends classes.Task {
constructor(taskArrayArg:classes.Task[]){
super({
task: function(){}
});
export class Taskchain extends Task {
taskArray:Task[];
private _oraObject;
constructor(optionsArg:{
name?:string,
log?:boolean,
taskArray:Task[]
}){
let options = plugins.lodash.assign(
{
name:"unnamed Task",
log:false
},
optionsArg,
{
taskFunction: () => { // this is the function that gets executed when TaskChain is triggered
console.log("running taskchain function");
let done = plugins.Q.defer(); // this is the starting Deferred object
let taskCounter = 0;
let iterateTasks = () => {
if(typeof this.taskArray[taskCounter] != "undefined"){
this.taskArray[taskCounter].trigger()
.then(()=>{
taskCounter++;
iterateTasks();
});
} else {
done.resolve();
}
};
iterateTasks();
return done.promise;
}
}
);
super(options);
this.taskArray = optionsArg.taskArray;
this._oraObject = new plugins.beautylog.Ora("Taskchain idle","blue");
}
}
addTask(taskArg:Task){
this.taskArray.push(taskArg);
};
removeTask(taskArg:Task){
//TODO
};
shiftTask(){
};
trigger(){
this._oraObject.start(this.name + " running...");
return helpers.runTask(this);
}
};
let myTask = new Taskchain(
{
taskArray: [
new Task({
taskFunction:function(){}
})
]
}
);

View File

View File

@ -1,6 +1,4 @@
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
Q: require("q")
};
export = plugins;
export import beautylog = require("beautylog");
export let Q = require("q");
export let lodash= require("lodash");

View File

@ -1,7 +1,8 @@
{
"ambientDependencies": {
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts",
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts"
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
"should": "registry:dt/should#8.1.1+20160316155526"
}
}