Skip to content

arunoda/node-thu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-thu

Simple utility to generate thunks on the fly

installation

npm install thu

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');

About

Simple utility to generate thunks on the fly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published