0.1.1 • Published 12 years ago

thu v0.1.1

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

node-thu

Simple utility to generate thunks on the fly

installation

npm install t

using with functions

var thu = require('thu');
var fs = require('fs');

var thunk = thu(fs.readFile, 'filename.txt', 'utf8');

thunk(function(err, result) {
  console.log(result);
});

using with objects

var thu = require('thu');
var redis = require('redis');
var client = redis.createClient();

var thunk1 = thu(client, 'set', 'key-name', 'value');
var thunk2 = thu(client, 'get', 'key-name');