node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org ยป


Content Mapper


Take content from one file, or url, and map it to another via a template.


Simple example:

Grab the top headline from Reddit and put it into a message.

`var contentUrl = "";
var mappingFcn = function($){
return { headline: $('.content .spacer:last .entry:first a:first').text() };
var templateFcn = function(){
return "Top Reddit headline: <%= headline %>!";

contentMapper(contentUrl, {
mappingFn: mappingFcn,
template: templateFcn
},function(err,res){ console.log(res); });


npm install contentmapper