Skip to content

ivolo/leader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leader

Learn more about a lead.

Build Status

Install

$ npm install ivolo/leader

Example

var Leader = require('leader');

var leader = Leader()
  .use(fullContact())
  .use(facebook()))
  .use(twitter())
  .use(linkedin())
  .use(github());
  .populate({ email: '[email protected]' }, function (err, person) {
   // ..
  });

Each leader plugin provides additional information about the person. This example plugin figures out if the person's email domain is interesting:

function domain (person, context, next) {
  var tokens = person.email.split('@');
  person.domain = tokens[1];
  person.interesting = tokens[1].indexOf('gmail') === -1;
  next();
}

You can tell leader to wait to run your plugin until you know something about the person:

function hasEmail (person) {
  return person.email != null;
}

var leader = Leader()
  .when(hasEmail, domain);

Plugins

Existing plugins for leader can:

Ånd we'd love plugins to:

  • query LinkedIn for the company domain
  • query Full Contact or Rapleaf for demographic information
  • search Google for their personal twitter
  • search Google for the person's domain
  • search Google for the person's personal blog or site

API

Leader()

Create a new Leader instance.

.use(plugin)

Add a leader plugin which is an object that contains a fn plugin and a wait function, like so { wait: hasEmail, fn: domain }

.when(wait, fn)

Execute the leader plugin fn when the wait function returns true. Read more about wait functions in parallel-ware.

.populate(person, callback)

Populate more information about the person.

.concurrency(max)

Set the max amount of plugin running concurrently.

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

About

Learn more about your leads

Resources

Stars

Watchers

Forks

Packages

No packages published