Skip to content

Latest commit

 

History

History
104 lines (70 loc) · 3.04 KB

API.md

File metadata and controls

104 lines (70 loc) · 3.04 KB

Table of Contents

HelloObjectAsync

Asynchronous class, called HelloObjectAsync

Examples

var module = require('index.js');
var Obj = new module.HelloObjectAsync('greg');

helloAsync

Say hello while doing expensive work in threads

Parameters

  • args Object different ways to alter the string
    • args.louder boolean adds exclamation points to the string
  • callback Function from whence the hello comes, returns a string

Examples

var module = require('index.js');
var Obj = new module.HelloObjectAsync('greg');
Obj.helloAsync({ louder: true }, function(err, result) {
  if (err) throw err;
  console.log(result); // => '...threads are busy async bees...hello greg!!!'
});

Returns String

HelloObject

Synchronous class, called HelloObject

Examples

var module = require('index.js');
var Obj = new module.HelloObject('greg');

hello

Say hello

Examples

var x = Obj.hello();
console.log(x); // => '...initialized an object...hello greg'

Returns String

helloAsync

This is an asynchronous standalone function that logs a string.

Parameters

  • args Object different ways to alter the string
    • args.louder boolean adds exclamation points to the string
  • callback Function from whence the hello comes, returns a string

Examples

var module = require('./path/to/lib/index.js');
module.helloAsync({ louder: true }, function(err, result) {
  if (err) throw err;
  console.log(result); // => "...threads are busy async bees...hello world!!!!"
});

Returns string

hello

This is a synchronous standalone function that logs a string.

Examples

var module = require('./path/to/lib/index.js');
var check = module.hello();
console.log(check); // => "hello world"

Returns string