thu

0.1.1 • Public • Published

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

/thu/

    Package Sidebar

    Install

    npm i thu

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • arunoda