jobs fix, reverted

This commit is contained in:
Martin Donnelly 2017-09-11 11:34:45 +01:00
parent 17166c74a4
commit b61e60cd5e
19 changed files with 1973 additions and 2260 deletions

22
.eslintrc Normal file
View File

@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"no-const-assign": "warn",
"no-this-before-super": "warn",
"no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": "warn",
"constructor-super": "warn",
"valid-typeof": "warn",
"indent": [2, 2, {SwitchCase: 1}]
}
}

File diff suppressed because it is too large Load Diff

202
fixer.js Normal file
View File

@ -0,0 +1,202 @@
const querystring = require('querystring');
let list = [
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.JobServe.com/MySearch/EDF47BEA6B31EF.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.JobServe.com/MySearch/3CAD044BEF2BFA.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.JobServe.com/MySearch/C7B25D86D0844A.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.JobServe.com/MySearch/64A3EEF615FA4C.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564698"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564712"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21942123"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33166238"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888173"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/m7dp711z2r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/pfvf7o7z2r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/lluqnt8z2r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/tu33qt8z2r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/u3btnz8z2r.xml"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33256062"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33450169"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34517029"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888105"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.technojobs.co.uk/rss.php/glasgow/searchtypeand/locationScotland/sortbyrelevant/jobtypeall"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobserve.com/MySearch/6FC7E9ED5F042ECB.rss"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html,%20asp,%20web,%20sql,%20delphi,%20vb,%20vbscript,%20php,%20ajax,%20mysql,%20sqlserver,%20javascript,%20intranet,%20vmware,%20virtulization&location_include=Abu%20Dhabi&compare_resolved=RE_ABUDHABI_UNITEDARABEMIRATES&compare_search=Abu%20Dhabi&jobtype=X&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=London&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CO_LONDON&compare_search=London&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Glasgow&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=TO_G1_GLASGOW&compare_search=Glasgow&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&search_emp_mkt_cd=ALL"
} ,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Germany&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CY_GERMANY&compare_search=Germany&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/b1d7e6c3a9a11964z3r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/b1d7e6c3a9a11964z3r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=web+developer+javascript&where=glasgow&jobType=Contract"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=javascript&where=glasgow&jobType=Contract"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=asp&where=glasgow&jobType=Contract%2Ftemp"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobserve.com/MySearch/CA49421A86CA3F74.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/ddeded091b6f6d33z3r.xml"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/3eafc1ea20f1ca02z3r.xml"
}
];
let newArray = list.map((item) => {
let encoded = querystring.escape(item.feed_url);
console.log(encoded);
return {count:item.count, 'feed_url' : `http://52.211.105.9:6566/${encoded}`}
});
console.log(JSON.stringify(newArray));

View File

@ -1,222 +1,107 @@
var outputFile = 'jobs-local', var outputFile = 'jobs-local',
RssBraider = require('rss-braider'), RssBraider = require('rss-braider'),
fs = require('fs'), fs = require('fs'),
ejs = require('ejs'), ejs = require('ejs'),
read = require('fs').readFileSync, read = require('fs').readFileSync,
join = require('path').join, join = require('path').join,
str = read(join(__dirname, '/templates/rss.ejs'), 'utf8'), str = read(join(__dirname, '/templates/rss.ejs'), 'utf8'),
feeds = {}; feeds = {};
// Pull feeds from config files: // Pull feeds from config files:
// feeds.simple_test_feed = require("./config/feed").feed; // feeds.simple_test_feed = require("./config/feed").feed;
// Or define in-line // Or define in-line
feeds.simple_test_feed = { feeds.simple_test_feed = {
"feed_name" : "feed", 'feed_name': 'feed',
"default_count" : 1, 'default_count': 1,
"no_cdata_fields" : [], // Don't wrap these fields in CDATA tags 'no_cdata_fields': [], // Don't wrap these fields in CDATA tags
"plugins" : ['filter_today_only' ], 'plugins': ['filter_today_only'],
"meta" : { 'meta': {
"title": "Jobs", 'title': 'Jobs',
"description": "Combined Jobs Feed", 'description': 'Combined Jobs Feed',
'site_url':'http://pipes.silvrtree.co.uk/jobs-local.xml' 'site_url': 'http://pipes.silvrtree.co.uk/jobs-local.xml'
}, },
"sources" : [ 'sources': [{
{ 'count': 100,
/* "name" : "JobServe",*/ 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.JobServe.com%2FMySearch%2FEDF47BEA6B31EF.rss'
"count" : 100, }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.JobServe.com%2FMySearch%2F3CAD044BEF2BFA.rss'}, {
"feed_url" : "http://www.JobServe.com/MySearch/EDF47BEA6B31EF.rss" 'count': 100,
}, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.JobServe.com%2FMySearch%2FC7B25D86D0844A.rss'
{ }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.JobServe.com%2FMySearch%2F64A3EEF615FA4C.rss'}, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D21564698'
"feed_url" : "http://www.JobServe.com/MySearch/3CAD044BEF2BFA.rss" }, {
}, 'count': 100,
{ 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D21564712'
/* "name" : "JobServe",*/ }, {
"count" : 100, 'count': 100,
"feed_url" : "http://www.JobServe.com/MySearch/C7B25D86D0844A.rss" 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D21942123'
}, }, {
{ 'count': 100,
/* "name" : "JobServe",*/ 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D33166238'
"count" : 100, }, {
"feed_url" : "http://www.JobServe.com/MySearch/64A3EEF615FA4C.rss" 'count': 100,
}, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D34888173'
{ }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fm7dp711z2r.xml'}, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fpfvf7o7z2r.xml'
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564698" }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Flluqnt8z2r.xml'}, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Ftu33qt8z2r.xml'
{ }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fu3btnz8z2r.xml'}, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.purelyit.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D33256062'
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564712" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.purelyit.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D33450169'
{ }, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.purelyit.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D34517029'
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21942123" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.purelyit.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26daysback%3D1%26jbe_id%3D34888105'
{ }, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.technojobs.co.uk%2Frss.php%2Fglasgow%2Fsearchtypeand%2FlocationScotland%2Fsortbyrelevant%2Fjobtypeall'
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33166238" }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobserve.com%2FMySearch%2F6FC7E9ED5F042ECB.rss'}, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26skill_atleast%3Dhtml%2C%2520asp%2C%2520web%2C%2520sql%2C%2520delphi%2C%2520vb%2C%2520vbscript%2C%2520php%2C%2520ajax%2C%2520mysql%2C%2520sqlserver%2C%2520javascript%2C%2520intranet%2C%2520vmware%2C%2520virtulization%26location_include%3DAbu%2520Dhabi%26compare_resolved%3DRE_ABUDHABI_UNITEDARABEMIRATES%26compare_search%3DAbu%2520Dhabi%26jobtype%3DX%26search_emp_mkt_cd%3DALL'
{ }, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26skill_atleast%3Dhtml%2520%2C%2520asp%2520%2C%2520web%2520%2C%2520sql%2520%2C%2520delphi%2520%2C%2520vb%2520%2C%2520vbscript%2520%2C%2520php%2520%2C%2520ajax%2520%2C%2520mysql%2520%2C%2520sqlserver%2520%2C%2520javascript%2520%2C%2520intranet%2520%2C%2520vmware%2520%2C%2520virtulization%26location_include%3DLondon%26location_within%3D10%26reqd_salary%3DANY%7C%26daysback%3D7%26scc%3DUK%26compare_resolved%3DCO_LONDON%26compare_search%3DLondon%26search_emp_mkt_cd%3DALL'
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888173" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26skill_atleast%3Dhtml%2520%2C%2520asp%2520%2C%2520web%2520%2C%2520sql%2520%2C%2520delphi%2520%2C%2520vb%2520%2C%2520vbscript%2520%2C%2520php%2520%2C%2520ajax%2520%2C%2520mysql%2520%2C%2520sqlserver%2520%2C%2520javascript%2520%2C%2520intranet%2520%2C%2520vmware%2520%2C%2520virtulization%26location_include%3DGlasgow%26location_within%3D10%26reqd_salary%3DANY%7C%26daysback%3D7%26scc%3DUK%26compare_resolved%3DTO_G1_GLASGOW%26compare_search%3DGlasgow%26search_emp_mkt_cd%3DALL'
{ }, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26skill_atleast%3Dhtml%2520%2C%2520asp%2520%2C%2520web%2520%2C%2520sql%2520%2C%2520delphi%2520%2C%2520vb%2520%2C%2520vbscript%2520%2C%2520php%2520%2C%2520ajax%2520%2C%2520mysql%2520%2C%2520sqlserver%2520%2C%2520javascript%2520%2C%2520intranet%2520%2C%2520vmware%2520%2C%2520virtulization%26location_within%3D10%26reqd_salary%3DANY%7C%26daysback%3D7%26scc%3DUK%26search_emp_mkt_cd%3DALL'
"feed_url" : "http://www.s1jobs.com/xml/m7dp711z2r.xml" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobsite.co.uk%2Fcgi-bin%2Fadvsearch%3Frss_feed%3D1%26skill_atleast%3Dhtml%2520%2C%2520asp%2520%2C%2520web%2520%2C%2520sql%2520%2C%2520delphi%2520%2C%2520vb%2520%2C%2520vbscript%2520%2C%2520php%2520%2C%2520ajax%2520%2C%2520mysql%2520%2C%2520sqlserver%2520%2C%2520javascript%2520%2C%2520intranet%2520%2C%2520vmware%2520%2C%2520virtulization%26location_include%3DGermany%26location_within%3D10%26reqd_salary%3DANY%7C%26daysback%3D7%26scc%3DUK%26compare_resolved%3DCY_GERMANY%26compare_search%3DGermany%26search_emp_mkt_cd%3DALL'
{ }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fb1d7e6c3a9a11964z3r.xml'}, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fb1d7e6c3a9a11964z3r.xml'
"feed_url" : "http://www.s1jobs.com/xml/pfvf7o7z2r.xml" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobisjob.co.uk%2Frss%3Fwhat%3Dweb%2Bdeveloper%2Bjavascript%26where%3Dglasgow%26jobType%3DContract'
{ }, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobisjob.co.uk%2Frss%3Fwhat%3Djavascript%26where%3Dglasgow%26jobType%3DContract'
"feed_url" : "http://www.s1jobs.com/xml/lluqnt8z2r.xml" }, {
} 'count': 100,
, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobisjob.co.uk%2Frss%3Fwhat%3Dasp%26where%3Dglasgow%26jobType%3DContract%252Ftemp'
{ }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.jobserve.com%2FMySearch%2FCA49421A86CA3F74.rss'}, {
/* "name" : "JobServe",*/ 'count': 100,
"count" : 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2Fddeded091b6f6d33z3r.xml'
"feed_url" : "http://www.s1jobs.com/xml/tu33qt8z2r.xml" }, {'count': 100, 'feed_url': 'http://52.211.105.9:6566/http%3A%2F%2Fwww.s1jobs.com%2Fxml%2F3eafc1ea20f1ca02z3r.xml'}]
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/u3btnz8z2r.xml"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33256062"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33450169"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34517029"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888105"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.technojobs.co.uk/rss.php/glasgow/searchtypeand/locationScotland/sortbyrelevant/jobtypeall"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobserve.com/MySearch/6FC7E9ED5F042ECB.rss"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html,%20asp,%20web,%20sql,%20delphi,%20vb,%20vbscript,%20php,%20ajax,%20mysql,%20sqlserver,%20javascript,%20intranet,%20vmware,%20virtulization&location_include=Abu%20Dhabi&compare_resolved=RE_ABUDHABI_UNITEDARABEMIRATES&compare_search=Abu%20Dhabi&jobtype=X&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=London&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CO_LONDON&compare_search=London&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Glasgow&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=TO_G1_GLASGOW&compare_search=Glasgow&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&search_emp_mkt_cd=ALL"
} ,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Germany&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CY_GERMANY&compare_search=Germany&search_emp_mkt_cd=ALL"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/b1d7e6c3a9a11964z3r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/b1d7e6c3a9a11964z3r.xml"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=web+developer+javascript&where=glasgow&jobType=Contract"
}
,
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=javascript&where=glasgow&jobType=Contract"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobisjob.co.uk/rss?what=asp&where=glasgow&jobType=Contract%2Ftemp"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.jobserve.com/MySearch/CA49421A86CA3F74.rss"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/ddeded091b6f6d33z3r.xml"
},
{
/* "name" : "JobServe",*/
"count" : 100,
"feed_url" : "http://www.s1jobs.com/xml/3eafc1ea20f1ca02z3r.xml"
}
]
}; };
var braider_options = { var braider_options = {
feeds: feeds, feeds: feeds,
indent: " ", indent: ' ',
date_sort_order: "desc", // Newest first date_sort_order: 'desc', // Newest first
log_level: "warn", log_level: 'warn',
dedupe_fields: ['link', 'guid'], dedupe_fields: ['link', 'guid'],
plugins_directories : [__dirname + "/plugins/"] plugins_directories: [__dirname + '/plugins/']
}; };
var rss_braider = RssBraider.createClient(braider_options); var rss_braider = RssBraider.createClient(braider_options);
@ -224,41 +109,41 @@ var rss_braider = RssBraider.createClient(braider_options);
rss_braider.logger.level('error'); rss_braider.logger.level('error');
rss_braider.processFeed('simple_test_feed', 'json', function (err, data) { rss_braider.processFeed('simple_test_feed', 'json', function (err, data) {
if (err) {
return console.log(err);
}
var j = JSON.parse(data);
var ejsOutput = ejs.compile(str)(j);
fs.writeFile(__dirname + '/dist/' + outputFile + '.html', ejsOutput, function (err) {
if (err) { if (err) {
return console.log(err); return console.log(err);
} }
var j = JSON.parse(data); console.log('The file was saved!');
var ejsOutput = ejs.compile(str)(j); });
fs.writeFile(__dirname + "/dist/" + outputFile + ".html", ejsOutput, function (err) { fs.writeFile(__dirname + '/dist/' + outputFile + '.json', data, function (err) {
if (err) {
logger.error(err);
return console.log(err);
}
if (err) { console.log('The file was saved!');
return console.log(err); });
}
console.log("The file was saved!");
});
fs.writeFile(__dirname + "/dist/" + outputFile + ".json", data, function (err) {
if (err) {
logger.error(err);
return console.log(err);
}
console.log("The file was saved!");
});
}); });
rss_braider.processFeed('simple_test_feed', 'rss', function (err, data) { rss_braider.processFeed('simple_test_feed', 'rss', function (err, data) {
if (err) {
return console.log(err);
}
fs.writeFile(__dirname + '/dist/' + outputFile + '.xml', data, function (err) {
if (err) { if (err) {
return console.log(err); return console.log(err);
} }
fs.writeFile(__dirname + "/dist/" + outputFile + ".xml", data, function (err) {
if (err) {
return console.log(err);
}
console.log("The file was saved!"); console.log('The file was saved!');
}); });
}); });

View File

@ -23,6 +23,11 @@ feeds.simple_test_feed = {
'site_url': 'http://pipes.silvrtree.co.uk/jobs-special.xml' 'site_url': 'http://pipes.silvrtree.co.uk/jobs-special.xml'
}, "sources": [ }, "sources": [
/*{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=47820652"
} ,*/
{ {
@ -49,6 +54,31 @@ feeds.simple_test_feed = {
"count": 100, "count": 100,
"feed_url": "http://www.JobServe.com/MySearch/64A3EEF615FA4C.rss" "feed_url": "http://www.JobServe.com/MySearch/64A3EEF615FA4C.rss"
}, },
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564698"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21564712"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=21942123"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=33166238"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888173"
},
{ {
"count": 100, "count": 100,
@ -94,11 +124,41 @@ feeds.simple_test_feed = {
"count": 100, "count": 100,
"feed_url": "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888105" "feed_url": "http://www.purelyit.co.uk/cgi-bin/advsearch?rss_feed=1&daysback=1&jbe_id=34888105"
}, },
{
"count": 100,
"feed_url": "http://www.technojobs.co.uk/rss.php/glasgow/searchtypeand/locationScotland/sortbyrelevant/jobtypeall"
},
{ {
"count": 100, "count": 100,
"feed_url": "http://www.jobserve.com/MySearch/6FC7E9ED5F042ECB.rss" "feed_url": "http://www.jobserve.com/MySearch/6FC7E9ED5F042ECB.rss"
}, },
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html,%20asp,%20web,%20sql,%20delphi,%20vb,%20vbscript,%20php,%20ajax,%20mysql,%20sqlserver,%20javascript,%20intranet,%20vmware,%20virtulization&location_include=Abu%20Dhabi&compare_resolved=RE_ABUDHABI_UNITEDARABEMIRATES&compare_search=Abu%20Dhabi&jobtype=X&search_emp_mkt_cd=ALL"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=London&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CO_LONDON&compare_search=London&search_emp_mkt_cd=ALL"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Glasgow&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=TO_G1_GLASGOW&compare_search=Glasgow&search_emp_mkt_cd=ALL"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&search_emp_mkt_cd=ALL"
},
{
"count": 100,
"feed_url": "http://www.jobsite.co.uk/cgi-bin/advsearch?rss_feed=1&skill_atleast=html%20,%20asp%20,%20web%20,%20sql%20,%20delphi%20,%20vb%20,%20vbscript%20,%20php%20,%20ajax%20,%20mysql%20,%20sqlserver%20,%20javascript%20,%20intranet%20,%20vmware%20,%20virtulization&location_include=Germany&location_within=10&reqd_salary=ANY|&daysback=7&scc=UK&compare_resolved=CY_GERMANY&compare_search=Germany&search_emp_mkt_cd=ALL"
},
{ {
"count": 100, "count": 100,
@ -123,7 +183,7 @@ feeds.simple_test_feed = {
"count": 100, "count": 100,
"feed_url": "http://www.s1jobs.com/xml/3eafc1ea20f1ca02z3r.xml" "feed_url": "http://www.s1jobs.com/xml/3eafc1ea20f1ca02z3r.xml"
} }*/
] ]
}; };

79
node_modules/ejs/Jakefile generated vendored
View File

@ -1,12 +1,10 @@
var fs = require('fs'); var fs = require('fs')
var execSync = require('child_process').execSync; , buildOpts = {
var exec = function (cmd) { printStdout: true
execSync(cmd, {stdio: 'inherit'}); , printStderr: true
}; };
/* global jake, task, desc, publishTask */ task('build', ['browserify', 'minify'], function () {
task('build', ['lint', 'clean', 'browserify', 'minify'], function () {
console.log('Build completed.'); console.log('Build completed.');
}); });
@ -14,58 +12,35 @@ desc('Cleans browerified/minified files and package files');
task('clean', ['clobber'], function () { task('clean', ['clobber'], function () {
jake.rmRf('./ejs.js'); jake.rmRf('./ejs.js');
jake.rmRf('./ejs.min.js'); jake.rmRf('./ejs.min.js');
console.log('Cleaned up compiled files.');
}); });
desc('Lints the source code'); task('browserify', {async: true}, function () {
task('lint', function () { jake.exec('./node_modules/browserify/bin/cmd.js lib/ejs.js > ejs.js',
exec('./node_modules/.bin/eslint \"**/*.js\" Jakefile'); buildOpts, function () {
console.log('Linting completed.'); console.log('Browserification completed.');
setTimeout(complete, 0);
});
}); });
task('browserify', function () { task('minify', {async: true}, function () {
exec('./node_modules/browserify/bin/cmd.js --standalone ejs lib/ejs.js > ejs.js'); jake.exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js',
console.log('Browserification completed.'); buildOpts, function () {
}); console.log('Minification completed.');
setTimeout(complete, 0);
task('minify', function () { });
exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js');
console.log('Minification completed.');
});
task('doc', function (dev) {
jake.rmRf('out');
var p = dev ? '-p' : '';
exec('./node_modules/.bin/jsdoc ' + p + ' -c jsdoc.json lib/* docs/jsdoc/*');
console.log('Documentation generated.');
});
task('docPublish', ['doc'], function () {
fs.writeFileSync('out/CNAME', 'api.ejs.co');
console.log('Pushing docs to gh-pages...');
exec('./node_modules/.bin/git-directory-deploy --directory out/');
console.log('Docs published to gh-pages.');
});
task('test', ['lint'], function () {
exec('./node_modules/.bin/mocha');
}); });
publishTask('ejs', ['build'], function () { publishTask('ejs', ['build'], function () {
this.packageFiles.include([ this.packageFiles.include([
'Jakefile', 'Jakefile'
'README.md', , 'README.md'
'LICENSE', , 'LICENSE'
'package.json', , 'package.json'
'ejs.js', , 'ejs.js'
'ejs.min.js', , 'ejs.min.js'
'lib/**', , 'lib/**'
'test/**' , 'test/**'
]); ]);
}); });
jake.Task.publish.on('complete', function () {
console.log('Updating hosted docs...');
console.log('If this fails, run jake docPublish to re-try.');
jake.Task.docPublish.invoke();
});

53
node_modules/ejs/README.md generated vendored
View File

@ -3,7 +3,7 @@
Embedded JavaScript templates Embedded JavaScript templates
[![Build Status](https://img.shields.io/travis/mde/ejs/master.svg?style=flat)](https://travis-ci.org/mde/ejs) [![Build Status](https://img.shields.io/travis/mde/ejs/master.svg?style=flat)](https://travis-ci.org/mde/ejs)
[![Developing Dependencies](https://img.shields.io/david/dev/mde/ejs.svg?style=flat)](https://david-dm.org/mde/ejs?type=dev) [![Developing Dependencies](https://img.shields.io/david/dev/mde/ejs.svg?style=flat)](https://david-dm.org/mde/ejs#info=devDependencies)
## Installation ## Installation
@ -18,7 +18,7 @@ $ npm install ejs
* Unescaped raw output with `<%- %>` * Unescaped raw output with `<%- %>`
* Newline-trim mode ('newline slurping') with `-%>` ending tag * Newline-trim mode ('newline slurping') with `-%>` ending tag
* Whitespace-trim mode (slurp all whitespace) for control flow with `<%_ _%>` * Whitespace-trim mode (slurp all whitespace) for control flow with `<%_ _%>`
* Custom delimiters (e.g., use `<? ?>` instead of `<% %>`) * Custom delimiters (e.g., use '<? ?>' instead of '<% %>')
* Includes * Includes
* Client-side support * Client-side support
* Static caching of intermediate JavaScript * Static caching of intermediate JavaScript
@ -33,8 +33,6 @@ $ npm install ejs
<% } %> <% } %>
``` ```
Try EJS online at: https://ionicabizau.github.io/ejs-playground/.
## Usage ## Usage
```javascript ```javascript
@ -52,20 +50,19 @@ ejs.renderFile(filename, data, options, function(err, str){
It is also possible to use `ejs.render(dataAndOptions);` where you pass It is also possible to use `ejs.render(dataAndOptions);` where you pass
everything in a single object. In that case, you'll end up with local variables everything in a single object. In that case, you'll end up with local variables
for all the passed options. However, be aware that your code could break if we for all the passed options. However, be aware that your code could break if we
add an option with the same name as one of your data object's properties. add an option with the same name as one of your data object's properties.
Therefore, we do not recommend using this shortcut. Therefore, we do not recommend using this shortcut.
## Options ## Options
- `cache` Compiled functions are cached, requires `filename` - `cache` Compiled functions are cached, requires `filename`
- `filename` The name of the file being rendered. Not required if you - `filename` The name of the file being rendered. Not required if you
are using `renderFile()`. Used by `cache` to key caches, and for includes. are using `renderFile()`. Used by `cache` to key caches, and for includes.
- `root` Set project root for includes with an absolute path (/file.ejs).
- `context` Function execution context - `context` Function execution context
- `compileDebug` When `false` no debug instrumentation is compiled - `compileDebug` When `false` no debug instrumentation is compiled
- `client` When `true`, compiles a function that can be rendered - `client` When `true`, compiles a function that can be rendered
in the browser without needing to load the EJS Runtime in the browser without needing to load the EJS Runtime
([ejs.min.js](https://github.com/mde/ejs/releases/latest)). ([ejs.min.js](https://github.com/mde/ejs/releases/latest)).
- `delimiter` Character to use with angle brackets for open/close - `delimiter` Character to use with angle brackets for open/close
- `debug` Output generated function body - `debug` Output generated function body
@ -79,9 +76,9 @@ Therefore, we do not recommend using this shortcut.
- `escape` The escaping function used with `<%=` construct. It is - `escape` The escaping function used with `<%=` construct. It is
used in rendering and is `.toString()`ed in the generation of client functions. (By default escapes XML). used in rendering and is `.toString()`ed in the generation of client functions. (By default escapes XML).
This project uses [JSDoc](http://usejsdoc.org/). For the full public API This project uses [JSDoc](http://usejsdoc.org/). For the full public API
documentation, clone the repository and run `npm run doc`. This will run JSDoc documentation, clone the repository and run `npm run doc`. This will run JSDoc
with the proper options and output the documentation to `out/`. If you want with the proper options and output the documentation to `out/`. If you want
the both the public & private API docs, run `npm run devdoc` instead. the both the public & private API docs, run `npm run devdoc` instead.
## Tags ## Tags
@ -92,7 +89,6 @@ the both the public & private API docs, run `npm run devdoc` instead.
- `<%-` Outputs the unescaped value into the template - `<%-` Outputs the unescaped value into the template
- `<%#` Comment tag, no execution, no output - `<%#` Comment tag, no execution, no output
- `<%%` Outputs a literal '<%' - `<%%` Outputs a literal '<%'
- `%%>` Outputs a literal '%>'
- `%>` Plain ending tag - `%>` Plain ending tag
- `-%>` Trim-mode ('newline slurp') tag, trims following newline - `-%>` Trim-mode ('newline slurp') tag, trims following newline
- `_%>` 'Whitespace Slurping' ending tag, removes all whitespace after it - `_%>` 'Whitespace Slurping' ending tag, removes all whitespace after it
@ -102,11 +98,11 @@ For the full syntax documentation, please see [docs/syntax.md](https://github.co
## Includes ## Includes
Includes either have to be an absolute path, or, if not, are assumed as Includes either have to be an absolute path, or, if not, are assumed as
relative to the template with the `include` call. For example if you are relative to the template with the `include` call. For example if you are
including `./views/user/show.ejs` from `./views/users.ejs` you would including `./views/user/show.ejs` from `./views/users.ejs` you would
use `<%- include('user/show') %>`. use `<%- include('user/show') %>`.
You must specify the `filename` option for the template with the `include` You must specify the `filename` option for the template with the `include`
call unless you are using `renderFile()`. call unless you are using `renderFile()`.
You'll likely want to use the raw output tag (`<%-`) with your include to avoid You'll likely want to use the raw output tag (`<%-`) with your include to avoid
@ -162,21 +158,6 @@ If you want to clear the EJS cache, call `ejs.clearCache`. If you're using the
LRU cache and need a different limit, simple reset `ejs.cache` to a new instance LRU cache and need a different limit, simple reset `ejs.cache` to a new instance
of the LRU. of the LRU.
## Custom FileLoader
The default file loader is `fs.readFileSync`, if you want to customize it, you can set ejs.fileLoader.
```javascript
var ejs = require('ejs');
var myFileLoad = function (filePath) {
return 'myFileLoad: ' + fs.readFileSync(filePath);
};
ejs.fileLoader = myFileLoad;
```
With this feature, you can preprocess the template before reading it.
## Layouts ## Layouts
EJS does not specifically support blocks, but layouts can be implemented by EJS does not specifically support blocks, but layouts can be implemented by
@ -197,8 +178,8 @@ including headers and footers, like so:
## Client-side support ## Client-side support
Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download
`./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning `./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning
the repository and running `jake build` (or `$(npm bin)/jake build` if jake is the repository and running `jake build` (or `$(npm bin)/jake build` if jake is
not installed globally). not installed globally).
Include one of these files on your page, and `ejs` should be available globally. Include one of these files on your page, and `ejs` should be available globally.
@ -227,11 +208,11 @@ Most of EJS will work as expected; however, there are a few things to note:
```javascript ```javascript
var str = "Hello <%= include('file', {person: 'John'}); %>", var str = "Hello <%= include('file', {person: 'John'}); %>",
fn = ejs.compile(str, {client: true}); fn = ejs.compile(str, {client: true});
fn(data, null, function(path, d){ // IncludeCallback fn(data, null, function(path, d){ // IncludeCallback
// path -> 'file' // path -> 'file'
// d -> {person: 'John'} // d -> {person: 'John'}
// Put your code here // Put your code here
// Return the contents of file as a string // Return the contents of file as a string
}); // returns rendered string }); // returns rendered string
``` ```
@ -254,3 +235,5 @@ Licensed under the Apache License, Version 2.0
- - - - - -
EJS Embedded JavaScript templates copyright 2112 EJS Embedded JavaScript templates copyright 2112
mde@fleegix.org. mde@fleegix.org.

780
node_modules/ejs/ejs.js generated vendored

File diff suppressed because it is too large Load Diff

2
node_modules/ejs/ejs.min.js generated vendored

File diff suppressed because one or more lines are too long

566
node_modules/ejs/lib/ejs.js generated vendored
View File

@ -19,7 +19,7 @@
'use strict'; 'use strict';
/** /**
* @file Embedded JavaScript templating engine. {@link http://ejs.co} * @file Embedded JavaScript templating engine.
* @author Matthew Eernisse <mde@fleegix.org> * @author Matthew Eernisse <mde@fleegix.org>
* @author Tiancheng "Timothy" Gu <timothygu99@gmail.com> * @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* @project EJS * @project EJS
@ -44,23 +44,19 @@
* @public * @public
*/ */
var fs = require('fs'); var fs = require('fs')
var path = require('path'); , utils = require('./utils')
var utils = require('./utils'); , scopeOptionWarned = false
, _VERSION_STRING = require('../package.json').version
var scopeOptionWarned = false; , _DEFAULT_DELIMITER = '%'
var _VERSION_STRING = require('../package.json').version; , _DEFAULT_LOCALS_NAME = 'locals'
var _DEFAULT_DELIMITER = '%'; , _REGEX_STRING = '(<%%|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'
var _DEFAULT_LOCALS_NAME = 'locals'; , _OPTS = [ 'cache', 'filename', 'delimiter', 'scope', 'context'
var _NAME = 'ejs'; , 'debug', 'compileDebug', 'client', '_with', 'rmWhitespace'
var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'; , 'strict', 'localsName'
var _OPTS = ['delimiter', 'scope', 'context', 'debug', 'compileDebug', ]
'client', '_with', 'rmWhitespace', 'strict', 'filename']; , _TRAILING_SEMCOL = /;\s*$/
// We don't allow 'cache' option to be passed in the data obj , _BOM = /^\uFEFF/;
// for the normal `render` call, but this is where Express puts it
// so we make an exception for `renderFile`
var _OPTS_EXPRESS = _OPTS.concat('cache');
var _BOM = /^\uFEFF/;
/** /**
* EJS template function cache. This can be a LRU object from lru-cache NPM * EJS template function cache. This can be a LRU object from lru-cache NPM
@ -72,19 +68,10 @@ var _BOM = /^\uFEFF/;
exports.cache = utils.cache; exports.cache = utils.cache;
/**
* Custom file loader. Useful for template preprocessing or restricting access
* to a certain part of the filesystem.
*
* @type {fileLoader}
*/
exports.fileLoader = fs.readFileSync;
/** /**
* Name of the object containing the locals. * Name of the object containing the locals.
* *
* This variable is overridden by {@link Options}`.localsName` if it is not * This variable is overriden by {@link Options}`.localsName` if it is not
* `undefined`. * `undefined`.
* *
* @type {String} * @type {String}
@ -97,44 +84,24 @@ exports.localsName = _DEFAULT_LOCALS_NAME;
* Get the path to the included file from the parent file path and the * Get the path to the included file from the parent file path and the
* specified path. * specified path.
* *
* @param {String} name specified path * @param {String} name specified path
* @param {String} filename parent file path * @param {String} filename parent file path
* @param {Boolean} isDir parent file path whether is directory
* @return {String} * @return {String}
*/ */
exports.resolveInclude = function(name, filename, isDir) {
var dirname = path.dirname; exports.resolveInclude = function(name, filename) {
var extname = path.extname; var path = require('path')
var resolve = path.resolve; , dirname = path.dirname
var includePath = resolve(isDir ? filename : dirname(filename), name); , extname = path.extname
var ext = extname(name); , resolve = path.resolve
, includePath = resolve(dirname(filename), name)
, ext = extname(name);
if (!ext) { if (!ext) {
includePath += '.ejs'; includePath += '.ejs';
} }
return includePath; return includePath;
}; };
/**
* Get the path to the included file by Options
*
* @param {String} path specified path
* @param {Options} options compilation options
* @return {String}
*/
function getIncludePath(path, options){
var includePath;
if (path.charAt(0) == '/') {
includePath = exports.resolveInclude(path.replace(/^\/*/,''), options.root || '/', true);
}
else {
if (!options.filename) {
throw new Error('`include` use relative path requires the \'filename\' option.');
}
includePath = exports.resolveInclude(path, options.filename);
}
return includePath;
}
/** /**
* Get the template from a string or a file, either compiled on-the-fly or * Get the template from a string or a file, either compiled on-the-fly or
* read from cache (if enabled), and cache the template if needed. * read from cache (if enabled), and cache the template if needed.
@ -154,70 +121,35 @@ function getIncludePath(path, options){
*/ */
function handleCache(options, template) { function handleCache(options, template) {
var func; var fn
var filename = options.filename; , path = options.filename
var hasTemplate = arguments.length > 1; , hasTemplate = arguments.length > 1;
if (options.cache) { if (options.cache) {
if (!filename) { if (!path) {
throw new Error('cache option requires a filename'); throw new Error('cache option requires a filename');
} }
func = exports.cache.get(filename); fn = exports.cache.get(path);
if (func) { if (fn) {
return func; return fn;
} }
if (!hasTemplate) { if (!hasTemplate) {
template = fileLoader(filename).toString().replace(_BOM, ''); template = fs.readFileSync(path).toString().replace(_BOM, '');
} }
} }
else if (!hasTemplate) { else if (!hasTemplate) {
// istanbul ignore if: should not happen at all // istanbul ignore if: should not happen at all
if (!filename) { if (!path) {
throw new Error('Internal EJS error: no file name or template ' throw new Error('Internal EJS error: no file name or template '
+ 'provided'); + 'provided');
} }
template = fileLoader(filename).toString().replace(_BOM, ''); template = fs.readFileSync(path).toString().replace(_BOM, '');
} }
func = exports.compile(template, options); fn = exports.compile(template, options);
if (options.cache) { if (options.cache) {
exports.cache.set(filename, func); exports.cache.set(path, fn);
} }
return func; return fn;
}
/**
* Try calling handleCache with the given options and data and call the
* callback with the result. If an error occurs, call the callback with
* the error. Used by renderFile().
*
* @memberof module:ejs-internal
* @param {Options} options compilation options
* @param {Object} data template data
* @param {RenderFileCallback} cb callback
* @static
*/
function tryHandleCache(options, data, cb) {
var result;
try {
result = handleCache(options)(data);
}
catch (err) {
return cb(err);
}
return cb(null, result);
}
/**
* fileLoader is independent
*
* @param {String} filePath ejs file path.
* @return {String} The contents of the specified file.
* @static
*/
function fileLoader(filePath){
return exports.fileLoader(filePath);
} }
/** /**
@ -235,7 +167,10 @@ function fileLoader(filePath){
function includeFile(path, options) { function includeFile(path, options) {
var opts = utils.shallowCopy({}, options); var opts = utils.shallowCopy({}, options);
opts.filename = getIncludePath(path, opts); if (!opts.filename) {
throw new Error('`include` requires the \'filename\' option.');
}
opts.filename = exports.resolveInclude(path, opts.filename);
return handleCache(opts); return handleCache(opts);
} }
@ -245,24 +180,24 @@ function includeFile(path, options) {
* @memberof module:ejs-internal * @memberof module:ejs-internal
* @param {String} path path for the specified file * @param {String} path path for the specified file
* @param {Options} options compilation options * @param {Options} options compilation options
* @return {Object} * @return {String}
* @static * @static
*/ */
function includeSource(path, options) { function includeSource(path, options) {
var opts = utils.shallowCopy({}, options); var opts = utils.shallowCopy({}, options)
var includePath; , includePath
var template; , template;
includePath = getIncludePath(path, opts); if (!opts.filename) {
template = fileLoader(includePath).toString().replace(_BOM, ''); throw new Error('`include` requires the \'filename\' option.');
}
includePath = exports.resolveInclude(path, opts.filename);
template = fs.readFileSync(includePath).toString().replace(_BOM, '');
opts.filename = includePath; opts.filename = includePath;
var templ = new Template(template, opts); var templ = new Template(template, opts);
templ.generateSource(); templ.generateSource();
return { return templ.source;
source: templ.source,
filename: includePath,
template: template
};
} }
/** /**
@ -278,11 +213,11 @@ function includeSource(path, options) {
* @static * @static
*/ */
function rethrow(err, str, flnm, lineno, esc){ function rethrow(err, str, filename, lineno){
var lines = str.split('\n'); var lines = str.split('\n')
var start = Math.max(lineno - 3, 0); , start = Math.max(lineno - 3, 0)
var end = Math.min(lines.length, lineno + 3); , end = Math.min(lines.length, lineno + 3);
var filename = esc(flnm); // eslint-disable-line
// Error context // Error context
var context = lines.slice(start, end).map(function (line, i){ var context = lines.slice(start, end).map(function (line, i){
var curr = i + start + 1; var curr = i + start + 1;
@ -302,8 +237,24 @@ function rethrow(err, str, flnm, lineno, esc){
throw err; throw err;
} }
function stripSemi(str){ /**
return str.replace(/;(\s*$)/, '$1'); * Copy properties in data object that are recognized as options to an
* options object.
*
* This is used for compatibility with earlier versions of EJS and Express.js.
*
* @memberof module:ejs-internal
* @param {Object} data data object
* @param {Options} opts options object
* @static
*/
function cpOptsInData(data, opts) {
_OPTS.forEach(function (p) {
if (typeof data[p] != 'undefined') {
opts[p] = data[p];
}
});
} }
/** /**
@ -351,14 +302,15 @@ exports.compile = function compile(template, opts) {
* @public * @public
*/ */
exports.render = function (template, d, o) { exports.render = function (template, data, opts) {
var data = d || {}; data = data || {};
var opts = o || {}; opts = opts || {};
var fn;
// No options object -- if there are optiony names // No options object -- if there are optiony names
// in the data, copy them to options // in the data, copy them to options
if (arguments.length == 2) { if (arguments.length == 2) {
utils.shallowCopyFromList(opts, data, _OPTS); cpOptsInData(data, opts);
} }
return handleCache(opts, template)(data); return handleCache(opts, template)(data);
@ -378,38 +330,37 @@ exports.render = function (template, d, o) {
*/ */
exports.renderFile = function () { exports.renderFile = function () {
var filename = arguments[0]; var args = Array.prototype.slice.call(arguments)
var cb = arguments[arguments.length - 1]; , path = args.shift()
var opts = {filename: filename}; , cb = args.pop()
var data; , data = args.shift() || {}
, opts = args.pop() || {}
, result;
if (arguments.length > 2) { // Don't pollute passed in opts obj with new vals
data = arguments[1]; opts = utils.shallowCopy({}, opts);
// No options object -- if there are optiony names // No options object -- if there are optiony names
// in the data, copy them to options // in the data, copy them to options
if (arguments.length === 3) { if (arguments.length == 3) {
// Express 4 // Express 4
if (data.settings && data.settings['view options']) { if (data.settings && data.settings['view options']) {
utils.shallowCopyFromList(opts, data.settings['view options'], _OPTS_EXPRESS); cpOptsInData(data.settings['view options'], opts);
}
// Express 3 and lower
else {
utils.shallowCopyFromList(opts, data, _OPTS_EXPRESS);
}
} }
// Express 3 and lower
else { else {
// Use shallowCopy so we don't pollute passed in opts obj with new vals cpOptsInData(data, opts);
utils.shallowCopy(opts, arguments[2]);
} }
opts.filename = filename;
}
else {
data = {};
} }
opts.filename = path;
return tryHandleCache(opts, data, cb); try {
result = handleCache(opts)(data);
}
catch(err) {
return cb(err);
}
return cb(null, result);
}; };
/** /**
@ -440,7 +391,6 @@ function Template(text, opts) {
options.context = opts.context; options.context = opts.context;
options.cache = opts.cache || false; options.cache = opts.cache || false;
options.rmWhitespace = opts.rmWhitespace; options.rmWhitespace = opts.rmWhitespace;
options.root = opts.root;
options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME; options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
if (options.strict) { if (options.strict) {
@ -456,28 +406,39 @@ function Template(text, opts) {
} }
Template.modes = { Template.modes = {
EVAL: 'eval', EVAL: 'eval'
ESCAPED: 'escaped', , ESCAPED: 'escaped'
RAW: 'raw', , RAW: 'raw'
COMMENT: 'comment', , COMMENT: 'comment'
LITERAL: 'literal' , LITERAL: 'literal'
}; };
Template.prototype = { Template.prototype = {
createRegex: function () { createRegex: function () {
var str = _REGEX_STRING; var str = _REGEX_STRING
var delim = utils.escapeRegExpChars(this.opts.delimiter); , delim = utils.escapeRegExpChars(this.opts.delimiter);
str = str.replace(/%/g, delim); str = str.replace(/%/g, delim);
return new RegExp(str); return new RegExp(str);
}, }
compile: function () { , compile: function () {
var src; var src
var fn; , fn
var opts = this.opts; , opts = this.opts
var prepended = ''; , prepended = ''
var appended = ''; , appended = ''
var escapeFn = opts.escapeFunction; , escape = opts.escapeFunction;
if (opts.rmWhitespace) {
// Have to use two separate replace here as `^` and `$` operators don't
// work well with `\r`.
this.templateText =
this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, '');
}
// Slurp spaces and tabs before <%_ and after _%>
this.templateText =
this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>');
if (!this.source) { if (!this.source) {
this.generateSource(); this.generateSource();
@ -498,7 +459,7 @@ Template.prototype = {
+ 'try {' + '\n' + 'try {' + '\n'
+ this.source + this.source
+ '} catch (e) {' + '\n' + '} catch (e) {' + '\n'
+ ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\n' + ' rethrow(e, __lines, __filename, __line);' + '\n'
+ '}' + '\n'; + '}' + '\n';
} }
else { else {
@ -510,7 +471,7 @@ Template.prototype = {
} }
if (opts.client) { if (opts.client) {
src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\n' + src; src = 'escape = escape || ' + escape.toString() + ';' + '\n' + src;
if (opts.compileDebug) { if (opts.compileDebug) {
src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src; src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\n' + src;
} }
@ -521,7 +482,7 @@ Template.prototype = {
} }
try { try {
fn = new Function(opts.localsName + ', escapeFn, include, rethrow', src); fn = new Function(opts.localsName + ', escape, include, rethrow', src);
} }
catch(e) { catch(e) {
// istanbul ignore else // istanbul ignore else
@ -529,9 +490,7 @@ Template.prototype = {
if (opts.filename) { if (opts.filename) {
e.message += ' in ' + opts.filename; e.message += ' in ' + opts.filename;
} }
e.message += ' while compiling ejs\n\n'; e.message += ' while compiling ejs';
e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\n';
e.message += 'https://github.com/RyanZim/EJS-Lint';
} }
throw e; throw e;
} }
@ -552,38 +511,28 @@ Template.prototype = {
} }
return includeFile(path, opts)(d); return includeFile(path, opts)(d);
}; };
return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]); return fn.apply(opts.context, [data || {}, escape, include, rethrow]);
}; };
returnedFn.dependencies = this.dependencies; returnedFn.dependencies = this.dependencies;
return returnedFn; return returnedFn;
}, }
generateSource: function () { , generateSource: function () {
var opts = this.opts; var self = this
, matches = this.parseTemplateText()
if (opts.rmWhitespace) { , d = this.opts.delimiter;
// Have to use two separate replace here as `^` and `$` operators don't
// work well with `\r`.
this.templateText =
this.templateText.replace(/\r/g, '').replace(/^\s+|\s+$/gm, '');
}
// Slurp spaces and tabs before <%_ and after _%>
this.templateText =
this.templateText.replace(/[ \t]*<%_/gm, '<%_').replace(/_%>[ \t]*/gm, '_%>');
var self = this;
var matches = this.parseTemplateText();
var d = this.opts.delimiter;
if (matches && matches.length) { if (matches && matches.length) {
if (this.opts.compileDebug && this.opts.filename) {
this.source = ' ; __lines = ' + JSON.stringify(this.templateText) + '\n';
this.source += ' ; __filename = "' + this.opts.filename.replace(/\\/g, '/') + '"\n';
}
matches.forEach(function (line, index) { matches.forEach(function (line, index) {
var opening; var opening
var closing; , closing
var include; , include
var includeOpts; , includeOpts
var includeObj; , includeSrc;
var includeSrc;
// If this is an opening tag, check for closing tags // If this is an opening tag, check for closing tags
// FIXME: May end up with some false positives here // FIXME: May end up with some false positives here
// Better to store modes as k/v with '<' + delimiter as key // Better to store modes as k/v with '<' + delimiter as key
@ -601,23 +550,9 @@ Template.prototype = {
// Must be in EVAL or RAW mode // Must be in EVAL or RAW mode
if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) { if (opening && (opening == '<' + d || opening == '<' + d + '-' || opening == '<' + d + '_')) {
includeOpts = utils.shallowCopy({}, self.opts); includeOpts = utils.shallowCopy({}, self.opts);
includeObj = includeSource(include[1], includeOpts); includeSrc = includeSource(include[1], includeOpts);
if (self.opts.compileDebug) { includeSrc = ' ; (function(){' + '\n' + includeSrc +
includeSrc = ' ; })()' + '\n';
' ; (function(){' + '\n'
+ ' var __line = 1' + '\n'
+ ' , __lines = ' + JSON.stringify(includeObj.template) + '\n'
+ ' , __filename = ' + JSON.stringify(includeObj.filename) + ';' + '\n'
+ ' try {' + '\n'
+ includeObj.source
+ ' } catch (e) {' + '\n'
+ ' rethrow(e, __lines, __filename, __line);' + '\n'
+ ' }' + '\n'
+ ' ; }).call(this)' + '\n';
}else{
includeSrc = ' ; (function(){' + '\n' + includeObj.source +
' ; }).call(this)' + '\n';
}
self.source += includeSrc; self.source += includeSrc;
self.dependencies.push(exports.resolveInclude(include[1], self.dependencies.push(exports.resolveInclude(include[1],
includeOpts.filename)); includeOpts.filename));
@ -628,17 +563,19 @@ Template.prototype = {
}); });
} }
}, }
parseTemplateText: function () { , parseTemplateText: function () {
var str = this.templateText; var str = this.templateText
var pat = this.regex; , pat = this.regex
var result = pat.exec(str); , result = pat.exec(str)
var arr = []; , arr = []
var firstPos; , firstPos
, lastPos;
while (result) { while (result) {
firstPos = result.index; firstPos = result.index;
lastPos = pat.lastIndex;
if (firstPos !== 0) { if (firstPos !== 0) {
arr.push(str.substring(0, firstPos)); arr.push(str.substring(0, firstPos));
@ -655,12 +592,12 @@ Template.prototype = {
} }
return arr; return arr;
}, }
scanLine: function (line) { , scanLine: function (line) {
var self = this; var self = this
var d = this.opts.delimiter; , d = this.opts.delimiter
var newLineCount = 0; , newLineCount = 0;
function _addOutput() { function _addOutput() {
if (self.truncate) { if (self.truncate) {
@ -669,12 +606,13 @@ Template.prototype = {
// after the tag that the truncation mode replaces // after the tag that the truncation mode replaces
// Handle Win / Unix / old Mac linebreaks -- do the \r\n // Handle Win / Unix / old Mac linebreaks -- do the \r\n
// combo first in the regex-or // combo first in the regex-or
line = line.replace(/^(?:\r\n|\r|\n)/, ''); line = line.replace(/^(?:\r\n|\r|\n)/, '')
self.truncate = false; self.truncate = false;
} }
else if (self.opts.rmWhitespace) { else if (self.opts.rmWhitespace) {
// rmWhitespace has already removed trailing spaces, just need // Gotta be more careful here.
// to remove linebreaks // .replace(/^(\s*)\n/, '$1') might be more appropriate here but as
// rmWhitespace already removes trailing spaces anyway so meh.
line = line.replace(/^\n/, ''); line = line.replace(/^\n/, '');
} }
if (!line) { if (!line) {
@ -697,75 +635,73 @@ Template.prototype = {
newLineCount = (line.split('\n').length - 1); newLineCount = (line.split('\n').length - 1);
switch (line) { switch (line) {
case '<' + d: case '<' + d:
case '<' + d + '_': case '<' + d + '_':
this.mode = Template.modes.EVAL; this.mode = Template.modes.EVAL;
break; break;
case '<' + d + '=': case '<' + d + '=':
this.mode = Template.modes.ESCAPED; this.mode = Template.modes.ESCAPED;
break; break;
case '<' + d + '-': case '<' + d + '-':
this.mode = Template.modes.RAW; this.mode = Template.modes.RAW;
break; break;
case '<' + d + '#': case '<' + d + '#':
this.mode = Template.modes.COMMENT; this.mode = Template.modes.COMMENT;
break; break;
case '<' + d + d: case '<' + d + d:
this.mode = Template.modes.LITERAL; this.mode = Template.modes.LITERAL;
this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n'; this.source += ' ; __append("' + line.replace('<' + d + d, '<' + d) + '")' + '\n';
break; break;
case d + d + '>': case d + '>':
this.mode = Template.modes.LITERAL; case '-' + d + '>':
this.source += ' ; __append("' + line.replace(d + d + '>', d + '>') + '")' + '\n'; case '_' + d + '>':
break; if (this.mode == Template.modes.LITERAL) {
case d + '>': _addOutput();
case '-' + d + '>': }
case '_' + d + '>':
if (this.mode == Template.modes.LITERAL) {
_addOutput();
}
this.mode = null; this.mode = null;
this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0; this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;
break; break;
default: default:
// In script mode, depends on type of tag // In script mode, depends on type of tag
if (this.mode) { if (this.mode) {
// If '//' is found without a line break, add a line break. // If '//' is found without a line break, add a line break.
switch (this.mode) { switch (this.mode) {
case Template.modes.EVAL: case Template.modes.EVAL:
case Template.modes.ESCAPED: case Template.modes.ESCAPED:
case Template.modes.RAW: case Template.modes.RAW:
if (line.lastIndexOf('//') > line.lastIndexOf('\n')) { if (line.lastIndexOf('//') > line.lastIndexOf('\n')) {
line += '\n'; line += '\n';
}
}
switch (this.mode) {
// Just executing code
case Template.modes.EVAL:
this.source += ' ; ' + line + '\n';
break;
// Exec, esc, and output
case Template.modes.ESCAPED:
this.source += ' ; __append(escape(' +
line.replace(_TRAILING_SEMCOL, '').trim() + '))' + '\n';
break;
// Exec and output
case Template.modes.RAW:
this.source += ' ; __append(' +
line.replace(_TRAILING_SEMCOL, '').trim() + ')' + '\n';
break;
case Template.modes.COMMENT:
// Do nothing
break;
// Literal <%% mode, append as raw output
case Template.modes.LITERAL:
_addOutput();
break;
} }
} }
switch (this.mode) {
// Just executing code
case Template.modes.EVAL:
this.source += ' ; ' + line + '\n';
break;
// Exec, esc, and output
case Template.modes.ESCAPED:
this.source += ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\n';
break;
// Exec and output
case Template.modes.RAW:
this.source += ' ; __append(' + stripSemi(line) + ')' + '\n';
break;
case Template.modes.COMMENT:
// Do nothing
break;
// Literal <%% mode, append as raw output
case Template.modes.LITERAL:
_addOutput();
break;
}
}
// In string mode, just add the output // In string mode, just add the output
else { else {
_addOutput(); _addOutput();
} }
} }
if (self.opts.compileDebug && newLineCount) { if (self.opts.compileDebug && newLineCount) {
@ -775,17 +711,9 @@ Template.prototype = {
} }
}; };
/** /*
* Escape characters reserved in XML. * Export the internal function for escaping XML so people
* * can use for manual escaping if needed
* This is simply an export of {@link module:utils.escapeXML}.
*
* If `markup` is `undefined` or `null`, the empty string is returned.
*
* @param {String} markup Input string
* @return {String} Escaped string
* @public
* @func
* */ * */
exports.escapeXML = utils.escapeXML; exports.escapeXML = utils.escapeXML;
@ -803,14 +731,14 @@ exports.__express = exports.renderFile;
// Add require support // Add require support
/* istanbul ignore else */ /* istanbul ignore else */
if (require.extensions) { if (require.extensions) {
require.extensions['.ejs'] = function (module, flnm) { require.extensions['.ejs'] = function (module, filename) {
var filename = flnm || /* istanbul ignore next */ module.filename; filename = filename || /* istanbul ignore next */ module.filename;
var options = { var options = {
filename: filename, filename: filename
client: true , client: true
}; }
var template = fileLoader(filename).toString(); , template = fs.readFileSync(filename).toString()
var fn = exports.compile(template, options); , fn = exports.compile(template, options);
module._compile('module.exports = ' + fn.toString() + ';', filename); module._compile('module.exports = ' + fn.toString() + ';', filename);
}; };
} }
@ -825,16 +753,6 @@ if (require.extensions) {
exports.VERSION = _VERSION_STRING; exports.VERSION = _VERSION_STRING;
/**
* Name for detection of EJS.
*
* @readonly
* @type {String}
* @public
*/
exports.name = _NAME;
/* istanbul ignore if */ /* istanbul ignore if */
if (typeof window != 'undefined') { if (typeof window != 'undefined') {
window.ejs = exports; window.ejs = exports;

45
node_modules/ejs/lib/utils.js generated vendored
View File

@ -45,17 +45,17 @@ exports.escapeRegExpChars = function (string) {
}; };
var _ENCODE_HTML_RULES = { var _ENCODE_HTML_RULES = {
'&': '&amp;', '&': '&amp;'
'<': '&lt;', , '<': '&lt;'
'>': '&gt;', , '>': '&gt;'
'"': '&#34;', , '"': '&#34;'
"'": '&#39;' , "'": '&#39;'
}; }
var _MATCH_HTML = /[&<>\'"]/g; , _MATCH_HTML = /[&<>\'"]/g;
function encode_char(c) { function encode_char(c) {
return _ENCODE_HTML_RULES[c] || c; return _ENCODE_HTML_RULES[c] || c;
} };
/** /**
* Stringified version of constants used by {@link module:utils.escapeXML}. * Stringified version of constants used by {@link module:utils.escapeXML}.
@ -98,13 +98,11 @@ exports.escapeXML = function (markup) {
.replace(_MATCH_HTML, encode_char); .replace(_MATCH_HTML, encode_char);
}; };
exports.escapeXML.toString = function () { exports.escapeXML.toString = function () {
return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr; return Function.prototype.toString.call(this) + ';\n' + escapeFuncStr
}; };
/** /**
* Naive copy of properties from one object to another. * Copy all properties from one object to another, in a shallow fashion.
* Does not recurse into non-scalar properties
* Does not check to see if the property has a value before copying
* *
* @param {Object} to Destination object * @param {Object} to Destination object
* @param {Object} from Source object * @param {Object} from Source object
@ -120,28 +118,6 @@ exports.shallowCopy = function (to, from) {
return to; return to;
}; };
/**
* Naive copy of a list of key names, from one object to another.
* Only copies property if it is actually defined
* Does not recurse into non-scalar properties
*
* @param {Object} to Destination object
* @param {Object} from Source object
* @param {Array} list List of properties to copy
* @return {Object} Destination object
* @static
* @private
*/
exports.shallowCopyFromList = function (to, from, list) {
for (var i = 0; i < list.length; i++) {
var p = list[i];
if (typeof from[p] != 'undefined') {
to[p] = from[p];
}
}
return to;
};
/** /**
* Simple in-process cache implementation. Does not implement limits of any * Simple in-process cache implementation. Does not implement limits of any
* sort. * sort.
@ -162,3 +138,4 @@ exports.cache = {
this._data = {}; this._data = {};
} }
}; };

87
node_modules/ejs/package.json generated vendored
View File

@ -1,52 +1,33 @@
{ {
"_args": [ "_args": [
[ [
{ "ejs@http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"name": "ejs", "/Users/martin/dev/Rinser"
"raw": "ejs@2.5.6",
"rawSpec": "2.5.6",
"scope": null,
"spec": "2.5.6",
"type": "version"
},
"/home/martind2000/dev/Rinser"
] ]
], ],
"_from": "ejs@2.5.6", "_from": "ejs@http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"_id": "ejs@2.5.6", "_id": "ejs@http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"_inCache": true, "_inBundle": false,
"_installable": true, "_integrity": "sha1-cFfrSBKVj7cxhBzZyjUzQ+/ll7E=",
"_location": "/ejs", "_location": "/ejs",
"_nodeVersion": "6.9.1",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/ejs-2.5.6.tgz_1487277787176_0.4875628533773124"
},
"_npmUser": {
"email": "mde@fleegix.org",
"name": "mde"
},
"_npmVersion": "3.10.8",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "remote",
"raw": "ejs@http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"name": "ejs", "name": "ejs",
"raw": "ejs@2.5.6", "escapedName": "ejs",
"rawSpec": "2.5.6", "rawSpec": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"scope": null, "saveSpec": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"spec": "2.5.6", "fetchSpec": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz"
"type": "version"
}, },
"_requiredBy": [ "_requiredBy": [
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.6.tgz", "_spec": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz",
"_shasum": "479636bfa3fe3b1debd52087f0acb204b4f19c88", "_where": "/Users/martin/dev/Rinser",
"_shrinkwrap": null,
"_spec": "ejs@2.5.6",
"_where": "/home/martind2000/dev/Rinser",
"author": { "author": {
"email": "mde@fleegix.org",
"name": "Matthew Eernisse", "name": "Matthew Eernisse",
"email": "mde@fleegix.org",
"url": "http://fleegix.org" "url": "http://fleegix.org"
}, },
"bugs": { "bugs": {
@ -54,28 +35,22 @@
}, },
"contributors": [ "contributors": [
{ {
"email": "timothygu99@gmail.com",
"name": "Timothy Gu", "name": "Timothy Gu",
"email": "timothygu99@gmail.com",
"url": "https://timothygu.github.io" "url": "https://timothygu.github.io"
} }
], ],
"dependencies": {}, "dependencies": {},
"description": "Embedded JavaScript templates", "description": "Embedded JavaScript templates",
"devDependencies": { "devDependencies": {
"browserify": "^13.0.1", "browserify": "^8.0.3",
"eslint": "^3.0.0", "istanbul": "~0.3.5",
"git-directory-deploy": "^1.5.1",
"istanbul": "~0.4.3",
"jake": "^8.0.0", "jake": "^8.0.0",
"jsdoc": "^3.4.0", "jsdoc": "^3.3.0-beta1",
"lru-cache": "^4.0.1", "lru-cache": "^2.5.0",
"mocha": "^3.0.2", "mocha": "^2.1.0",
"uglify-js": "^2.6.2" "rimraf": "^2.2.8",
}, "uglify-js": "^2.4.16"
"directories": {},
"dist": {
"shasum": "479636bfa3fe3b1debd52087f0acb204b4f19c88",
"tarball": "https://registry.npmjs.org/ejs/-/ejs-2.5.6.tgz"
}, },
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
@ -88,25 +63,17 @@
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "./lib/ejs.js", "main": "./lib/ejs.js",
"maintainers": [
{
"email": "mde@fleegix.org",
"name": "mde"
}
],
"name": "ejs", "name": "ejs",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/mde/ejs.git" "url": "git://github.com/mde/ejs.git"
}, },
"scripts": { "scripts": {
"coverage": "istanbul cover node_modules/mocha/bin/_mocha", "coverage": "istanbul cover node_modules/mocha/bin/_mocha",
"devdoc": "jake doc[dev]", "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*",
"doc": "jake doc", "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",
"lint": "eslint \"**/*.js\" Jakefile", "sample": "npm install express && node sample/index.js",
"test": "mocha" "test": "mocha"
}, },
"version": "2.5.6" "version": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz"
} }

345
node_modules/ejs/test/ejs.js generated vendored
View File

@ -1,16 +1,15 @@
/* jshint mocha: true */ /* jshint mocha: true */
/* eslint-env node, mocha */
/** /**
* Module dependencies. * Module dependencies.
*/ */
var ejs = require('..'); var ejs = require('..')
var fs = require('fs'); , fs = require('fs')
var read = fs.readFileSync; , read = fs.readFileSync
var assert = require('assert'); , assert = require('assert')
var path = require('path'); , path = require('path')
var LRU = require('lru-cache'); , LRU = require('lru-cache');
try { try {
fs.mkdirSync(__dirname + '/tmp'); fs.mkdirSync(__dirname + '/tmp');
@ -104,28 +103,10 @@ suite('ejs.compile(str, options)', function () {
delete ejs.delimiter; delete ejs.delimiter;
}); });
test('support custom escape function', function () {
var customEscape;
var fn;
customEscape = function customEscape(str) {
return !str ? '' : str.toUpperCase();
};
fn = ejs.compile('HELLO <%= name %>', {escape: customEscape});
assert.equal(fn({name: 'world'}), 'HELLO WORLD');
});
test('strict mode works', function () {
assert.equal(ejs.render(fixture('strict.ejs'), {}, {strict: true}), 'true');
});
});
suite('client mode', function () {
test('have a working client option', function () { test('have a working client option', function () {
var fn; var fn
var str; , str
var preFn; , preFn;
fn = ejs.compile('<p><%= foo %></p>', {client: true}); fn = ejs.compile('<p><%= foo %></p>', {client: true});
str = fn.toString(); str = fn.toString();
if (!process.env.running_under_istanbul) { if (!process.env.running_under_istanbul) {
@ -135,9 +116,9 @@ suite('client mode', function () {
}); });
test('support client mode without locals', function () { test('support client mode without locals', function () {
var fn; var fn
var str; , str
var preFn; , preFn;
fn = ejs.compile('<p><%= "foo" %></p>', {client: true}); fn = ejs.compile('<p><%= "foo" %></p>', {client: true});
str = fn.toString(); str = fn.toString();
if (!process.env.running_under_istanbul) { if (!process.env.running_under_istanbul) {
@ -148,17 +129,27 @@ suite('client mode', function () {
test('not include rethrow() in client mode if compileDebug is false', function () { test('not include rethrow() in client mode if compileDebug is false', function () {
var fn = ejs.compile('<p><%= "foo" %></p>', { var fn = ejs.compile('<p><%= "foo" %></p>', {
client: true, client: true
compileDebug: false , compileDebug: false
}); });
// There could be a `rethrow` in the function declaration // There could be a `rethrow` in the function declaration
assert((fn.toString().match(/rethrow/g) || []).length <= 1); assert((fn.toString().match(/rethrow/g) || []).length <= 1);
}); });
test('support custom escape function', function () {
var customEscape
, fn;
customEscape = function customEscape(str) {
return !str ? '' : str.toUpperCase();
};
fn = ejs.compile('HELLO <%= name %>', {escape: customEscape});
assert.equal(fn({name: 'world'}), 'HELLO WORLD');
});
test('support custom escape function in client mode', function () { test('support custom escape function in client mode', function () {
var customEscape; var customEscape
var fn; , fn
var str; , str;
customEscape = function customEscape(str) { customEscape = function customEscape(str) {
return !str ? '' : str.toUpperCase(); return !str ? '' : str.toUpperCase();
}; };
@ -166,31 +157,10 @@ suite('client mode', function () {
str = fn.toString(); str = fn.toString();
if (!process.env.running_under_istanbul) { if (!process.env.running_under_istanbul) {
eval('var preFn = ' + str); eval('var preFn = ' + str);
assert.equal(preFn({name: 'world'}), 'HELLO WORLD'); // eslint-disable-line no-undef assert.equal(preFn({name: 'world'}), 'HELLO WORLD');
} }
}); });
test('escape filename in errors in client mode', function () {
assert.throws(function () {
var fn = ejs.compile('<% throw new Error("whoops"); %>', {client: true, filename: '<script>'});
fn();
}, /Error: &lt;script&gt;/);
});
});
/* Old API -- remove when this shim goes away */
suite('ejs.render(str, dataAndOpts)', function () {
test('render the template with data/opts passed together', function () {
assert.equal(ejs.render('<p><?= foo ?></p>', {foo: 'yay', delimiter: '?'}),
'<p>yay</p>');
});
test('disallow unsafe opts passed along in data', function () {
assert.equal(ejs.render('<p><?= locals.foo ?></p>',
// localsName should not get reset because it's blacklisted
{_with: false, foo: 'yay', delimiter: '?', localsName: '_'}),
'<p>yay</p>');
});
}); });
suite('ejs.render(str, data, opts)', function () { suite('ejs.render(str, data, opts)', function () {
@ -254,10 +224,10 @@ suite('ejs.render(str, data, opts)', function () {
}); });
test('support caching', function () { test('support caching', function () {
var file = __dirname + '/tmp/render.ejs'; var file = __dirname + '/tmp/render.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out = ejs.render('<p>Old</p>', {}, options); , out = ejs.render('<p>Old</p>', {}, options)
var expected = '<p>Old</p>'; , expected = '<p>Old</p>';
assert.equal(out, expected); assert.equal(out, expected);
// Assert no change, still in cache // Assert no change, still in cache
out = ejs.render('<p>New</p>', {}, options); out = ejs.render('<p>New</p>', {}, options);
@ -265,11 +235,11 @@ suite('ejs.render(str, data, opts)', function () {
}); });
test('support LRU caching', function () { test('support LRU caching', function () {
var oldCache = ejs.cache; var oldCache = ejs.cache
var file = __dirname + '/tmp/render.ejs'; , file = __dirname + '/tmp/render.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out; , out
var expected = '<p>Old</p>'; , expected = '<p>Old</p>';
// Switch to LRU // Switch to LRU
ejs.cache = LRU(); ejs.cache = LRU();
@ -285,8 +255,8 @@ suite('ejs.render(str, data, opts)', function () {
}); });
test('opts.context', function () { test('opts.context', function () {
var ctxt = {foo: 'FOO'}; var ctxt = {foo: 'FOO'}
var out = ejs.render('<%= this.foo %>', {}, {context: ctxt}); , out = ejs.render('<%= this.foo %>', {}, {context: ctxt});
assert.equal(out, ctxt.foo); assert.equal(out, ctxt.foo);
}); });
}); });
@ -303,8 +273,8 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
}); });
test('accept locals', function(done) { test('accept locals', function(done) {
var data = {name: 'fonebone'}; var data = {name: 'fonebone'}
var options = {delimiter: '$'}; , options = {delimiter: '$'};
ejs.renderFile('test/fixtures/user.ejs', data, options, function(err, html) { ejs.renderFile('test/fixtures/user.ejs', data, options, function(err, html) {
if (err) { if (err) {
return done(err); return done(err);
@ -315,10 +285,11 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
}); });
test('accept locals without using with() {}', function(done) { test('accept locals without using with() {}', function(done) {
var data = {name: 'fonebone'}; var data = {name: 'fonebone'}
var options = {delimiter: '$', _with: false}; , options = {delimiter: '$', _with: false}
var doneCount = 0; , doneCount = 0;
ejs.renderFile('test/fixtures/user-no-with.ejs', data, options, function(err, html) { ejs.renderFile('test/fixtures/user-no-with.ejs', data, options,
function(err, html) {
if (err) { if (err) {
if (doneCount === 2) { if (doneCount === 2) {
return; return;
@ -348,9 +319,9 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
}); });
test('not catch err thrown by callback', function(done) { test('not catch err thrown by callback', function(done) {
var data = {name: 'fonebone'}; var data = {name: 'fonebone'}
var options = {delimiter: '$'}; , options = {delimiter: '$'}
var counter = 0; , counter = 0;
var d = require('domain').create(); var d = require('domain').create();
d.on('error', function (err) { d.on('error', function (err) {
@ -365,7 +336,8 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
// domains. Have to make it async. Ticket closed because: "domains are // domains. Have to make it async. Ticket closed because: "domains are
// deprecated :D" // deprecated :D"
process.nextTick(function () { process.nextTick(function () {
ejs.renderFile('test/fixtures/user.ejs', data, options, function(err) { ejs.renderFile('test/fixtures/user.ejs', data, options,
function(err) {
counter++; counter++;
if (err) { if (err) {
assert.notEqual(err.message, 'Exception in callback'); assert.notEqual(err.message, 'Exception in callback');
@ -378,9 +350,9 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
}); });
test('support caching', function (done) { test('support caching', function (done) {
var expected = '<p>Old</p>'; var expected = '<p>Old</p>'
var file = __dirname + '/tmp/renderFile.ejs'; , file = __dirname + '/tmp/renderFile.ejs'
var options = {cache: true}; , options = {cache: true};
fs.writeFileSync(file, '<p>Old</p>'); fs.writeFileSync(file, '<p>Old</p>');
ejs.renderFile(file, {}, options, function (err, out) { ejs.renderFile(file, {}, options, function (err, out) {
@ -403,7 +375,8 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
test('opts.context', function (done) { test('opts.context', function (done) {
var ctxt = {foo: 'FOO'}; var ctxt = {foo: 'FOO'};
ejs.renderFile('test/fixtures/with-context.ejs', {}, {context: ctxt}, function(err, html) { ejs.renderFile('test/fixtures/with-context.ejs', {},
{context: ctxt}, function(err, html) {
if (err) { if (err) {
return done(err); return done(err);
} }
@ -416,10 +389,10 @@ suite('ejs.renderFile(path, [data], [options], fn)', function () {
suite('cache specific', function () { suite('cache specific', function () {
test('`clearCache` work properly', function () { test('`clearCache` work properly', function () {
var expected = '<p>Old</p>'; var expected = '<p>Old</p>'
var file = __dirname + '/tmp/clearCache.ejs'; , file = __dirname + '/tmp/clearCache.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out = ejs.render('<p>Old</p>', {}, options); , out = ejs.render('<p>Old</p>', {}, options);
assert.equal(out, expected); assert.equal(out, expected);
ejs.clearCache(); ejs.clearCache();
@ -430,11 +403,11 @@ suite('cache specific', function () {
}); });
test('`clearCache` work properly, LRU', function () { test('`clearCache` work properly, LRU', function () {
var expected = '<p>Old</p>'; var expected = '<p>Old</p>'
var oldCache = ejs.cache; , oldCache = ejs.cache
var file = __dirname + '/tmp/clearCache.ejs'; , file = __dirname + '/tmp/clearCache.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out; , out;
ejs.cache = LRU(); ejs.cache = LRU();
@ -449,11 +422,11 @@ suite('cache specific', function () {
}); });
test('LRU with cache-size 1', function () { test('LRU with cache-size 1', function () {
var oldCache = ejs.cache; var oldCache = ejs.cache
var options; , options
var out; , out
var expected; , expected
var file; , file;
ejs.cache = LRU(1); ejs.cache = LRU(1);
@ -499,11 +472,6 @@ suite('<%', function () {
}); });
suite('<%=', function () { suite('<%=', function () {
test('should not throw an error with a // comment on the final line', function () {
assert.equal(ejs.render('<%=\n// a comment\nname\n// another comment %>', {name: '&nbsp;<script>'}),
'&amp;nbsp;&lt;script&gt;');
});
test('escape &amp;<script>', function () { test('escape &amp;<script>', function () {
assert.equal(ejs.render('<%= name %>', {name: '&nbsp;<script>'}), assert.equal(ejs.render('<%= name %>', {name: '&nbsp;<script>'}),
'&amp;nbsp;&lt;script&gt;'); '&amp;nbsp;&lt;script&gt;');
@ -533,11 +501,6 @@ suite('<%=', function () {
}); });
suite('<%-', function () { suite('<%-', function () {
test('should not throw an error with a // comment on the final line', function () {
assert.equal(ejs.render('<%-\n// a comment\nname\n// another comment %>', {name: '&nbsp;<script>'}),
'&nbsp;<script>');
});
test('not escape', function () { test('not escape', function () {
assert.equal(ejs.render('<%- name %>', {name: '<script>'}), assert.equal(ejs.render('<%- name %>', {name: '<script>'}),
'<script>'); '<script>');
@ -588,13 +551,13 @@ suite('-%>', function () {
}); });
test('works with unix style', function () { test('works with unix style', function () {
var content = '<ul><% -%>\n' var content = "<ul><% -%>\n"
+ '<% users.forEach(function(user){ -%>\n' + "<% users.forEach(function(user){ -%>\n"
+ '<li><%= user.name -%></li>\n' + "<li><%= user.name -%></li>\n"
+ '<% }) -%>\n' + "<% }) -%>\n"
+ '</ul><% -%>\n'; + "</ul><% -%>\n";
var expectedResult = '<ul><li>geddy</li>\n<li>neil</li>\n<li>alex</li>\n</ul>'; var expectedResult = "<ul><li>geddy</li>\n<li>neil</li>\n<li>alex</li>\n</ul>";
var fn; var fn;
fn = ejs.compile(content); fn = ejs.compile(content);
assert.equal(fn({users: users}), assert.equal(fn({users: users}),
@ -602,13 +565,13 @@ suite('-%>', function () {
}); });
test('works with windows style', function () { test('works with windows style', function () {
var content = '<ul><% -%>\r\n' var content = "<ul><% -%>\r\n"
+ '<% users.forEach(function(user){ -%>\r\n' + "<% users.forEach(function(user){ -%>\r\n"
+ '<li><%= user.name -%></li>\r\n' + "<li><%= user.name -%></li>\r\n"
+ '<% }) -%>\r\n' + "<% }) -%>\r\n"
+ '</ul><% -%>\r\n'; + "</ul><% -%>\r\n";
var expectedResult = '<ul><li>geddy</li>\r\n<li>neil</li>\r\n<li>alex</li>\r\n</ul>'; var expectedResult = "<ul><li>geddy</li>\r\n<li>neil</li>\r\n<li>alex</li>\r\n</ul>";
var fn; var fn;
fn = ejs.compile(content); fn = ejs.compile(content);
assert.equal(fn({users: users}), assert.equal(fn({users: users}),
@ -628,15 +591,6 @@ suite('<%%', function () {
}); });
}); });
suite('%%>', function () {
test('produce literal', function () {
assert.equal(ejs.render('%%>'),
'%>');
assert.equal(ejs.render(' >', {}, {delimiter: ' '}),
' >');
});
});
suite('<%_ and _%>', function () { suite('<%_ and _%>', function () {
test('slurps spaces and tabs', function () { test('slurps spaces and tabs', function () {
assert.equal(ejs.render(fixture('space-and-tab-slurp.ejs'), {users: users}), assert.equal(ejs.render(fixture('space-and-tab-slurp.ejs'), {users: users}),
@ -702,8 +656,8 @@ suite('exceptions', function () {
var unhook = null; var unhook = null;
test('log JS source when debug is set', function (done) { test('log JS source when debug is set', function (done) {
var out = ''; var out = ''
var needToExit = false; , needToExit = false;
unhook = hook_stdio(process.stdout, function (str) { unhook = hook_stdio(process.stdout, function (str) {
out += str; out += str;
if (needToExit) { if (needToExit) {
@ -718,22 +672,6 @@ suite('exceptions', function () {
}); });
ejs.render(fixture('hello-world.ejs'), {}, {debug: true}); ejs.render(fixture('hello-world.ejs'), {}, {debug: true});
}); });
test('escape filename in errors', function () {
assert.throws(function () {
ejs.render('<% throw new Error("whoops"); %>', {}, {filename: '<script>'});
}, /Error: &lt;script&gt;/);
});
test('filename in errors uses custom escape', function () {
assert.throws(function () {
ejs.render('<% throw new Error("whoops"); %>', {}, {
filename: '<script>',
escape: function () { return 'zooby'; }
});
}, /Error: zooby/);
});
teardown(function() { teardown(function() {
if (!unhook) { if (!unhook) {
return; return;
@ -789,13 +727,6 @@ suite('include()', function () {
fixture('include.html')); fixture('include.html'));
}); });
test('include ejs with set root path', function () {
var file = 'test/fixtures/include-root.ejs';
var viewsPath = path.join(__dirname, 'fixtures');
assert.equal(ejs.render(fixture('include-root.ejs'), {pets: users}, {filename: file, delimiter: '@',root:viewsPath}),
fixture('include.html'));
});
test('work when nested', function () { test('work when nested', function () {
var file = 'test/fixtures/menu.ejs'; var file = 'test/fixtures/menu.ejs';
assert.equal(ejs.render(fixture('menu.ejs'), {pets: users}, {filename: file}), assert.equal(ejs.render(fixture('menu.ejs'), {pets: users}, {filename: file}),
@ -803,8 +734,8 @@ suite('include()', function () {
}); });
test('work with a variable path', function () { test('work with a variable path', function () {
var file = 'test/fixtures/menu_var.ejs'; var file = 'test/fixtures/menu_var.ejs',
var includePath = 'includes/menu-item'; includePath = 'includes/menu-item';
assert.equal(ejs.render(fixture('menu.ejs'), {pets: users, varPath: includePath}, {filename: file}), assert.equal(ejs.render(fixture('menu.ejs'), {pets: users, varPath: includePath}, {filename: file}),
fixture('menu.html')); fixture('menu.html'));
}); });
@ -816,12 +747,12 @@ suite('include()', function () {
}); });
test('pass compileDebug to include', function () { test('pass compileDebug to include', function () {
var file = 'test/fixtures/include.ejs'; var file = 'test/fixtures/include.ejs'
var fn; , fn;
fn = ejs.compile(fixture('include.ejs'), { fn = ejs.compile(fixture('include.ejs'), {
filename: file, filename: file
delimiter: '@', , delimiter: '@'
compileDebug: false , compileDebug: false
}); });
try { try {
// Render without a required variable reference // Render without a required variable reference
@ -837,9 +768,9 @@ suite('include()', function () {
test('is dynamic', function () { test('is dynamic', function () {
fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>Old</p>'); fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>Old</p>');
var file = 'test/fixtures/include_cache.ejs'; var file = 'test/fixtures/include_cache.ejs'
var options = {filename: file}; , options = {filename: file}
var out = ejs.compile(fixture('include_cache.ejs'), options); , out = ejs.compile(fixture('include_cache.ejs'), options);
assert.equal(out(), '<p>Old</p>\n'); assert.equal(out(), '<p>Old</p>\n');
fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>New</p>'); fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>New</p>');
@ -848,10 +779,10 @@ suite('include()', function () {
test('support caching', function () { test('support caching', function () {
fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>Old</p>'); fs.writeFileSync(__dirname + '/tmp/include.ejs', '<p>Old</p>');
var file = 'test/fixtures/include_cache.ejs'; var file = 'test/fixtures/include_cache.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out = ejs.render(fixture('include_cache.ejs'), {}, options); , out = ejs.render(fixture('include_cache.ejs'), {}, options)
var expected = fixture('include_cache.html'); , expected = fixture('include_cache.html');
assert.equal(out, expected); assert.equal(out, expected);
out = ejs.render(fixture('include_cache.ejs'), {}, options); out = ejs.render(fixture('include_cache.ejs'), {}, options);
// No change, still in cache // No change, still in cache
@ -899,8 +830,8 @@ suite('preprocessor include', function () {
}); });
test('tracks dependency correctly', function () { test('tracks dependency correctly', function () {
var file = 'test/fixtures/menu_preprocessor.ejs'; var file = 'test/fixtures/menu_preprocessor.ejs'
var fn = ejs.compile(fixture('menu_preprocessor.ejs'), {filename: file}); , fn = ejs.compile(fixture('menu_preprocessor.ejs'), {filename: file});
assert(fn.dependencies.length); assert(fn.dependencies.length);
}); });
@ -911,12 +842,12 @@ suite('preprocessor include', function () {
}); });
test('pass compileDebug to include', function () { test('pass compileDebug to include', function () {
var file = 'test/fixtures/include_preprocessor.ejs'; var file = 'test/fixtures/include_preprocessor.ejs'
var fn; , fn;
fn = ejs.compile(fixture('include_preprocessor.ejs'), { fn = ejs.compile(fixture('include_preprocessor.ejs'), {
filename: file, filename: file
delimiter: '@', , delimiter: '@'
compileDebug: false , compileDebug: false
}); });
try { try {
// Render without a required variable reference // Render without a required variable reference
@ -932,9 +863,9 @@ suite('preprocessor include', function () {
test('is static', function () { test('is static', function () {
fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>Old</p>'); fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>Old</p>');
var file = 'test/fixtures/include_preprocessor_cache.ejs'; var file = 'test/fixtures/include_preprocessor_cache.ejs'
var options = {filename: file}; , options = {filename: file}
var out = ejs.compile(fixture('include_preprocessor_cache.ejs'), options); , out = ejs.compile(fixture('include_preprocessor_cache.ejs'), options);
assert.equal(out(), '<p>Old</p>\n'); assert.equal(out(), '<p>Old</p>\n');
fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>New</p>'); fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>New</p>');
@ -943,25 +874,16 @@ suite('preprocessor include', function () {
test('support caching', function () { test('support caching', function () {
fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>Old</p>'); fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>Old</p>');
var file = 'test/fixtures/include_preprocessor_cache.ejs'; var file = 'test/fixtures/include_preprocessor_cache.ejs'
var options = {cache: true, filename: file}; , options = {cache: true, filename: file}
var out = ejs.render(fixture('include_preprocessor_cache.ejs'), {}, options); , out = ejs.render(fixture('include_preprocessor_cache.ejs'), {}, options)
var expected = fixture('include_preprocessor_cache.html'); , expected = fixture('include_preprocessor_cache.html');
assert.equal(out, expected); assert.equal(out, expected);
fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>New</p>'); fs.writeFileSync(__dirname + '/tmp/include_preprocessor.ejs', '<p>New</p>');
out = ejs.render(fixture('include_preprocessor_cache.ejs'), {}, options); out = ejs.render(fixture('include_preprocessor_cache.ejs'), {}, options);
assert.equal(out, expected); assert.equal(out, expected);
}); });
test('whitespace slurp and rmWhitespace work', function() {
var file = 'test/fixtures/include_preprocessor_line_slurp.ejs';
var template = fixture('include_preprocessor_line_slurp.ejs');
var expected = fixture('include_preprocessor_line_slurp.html');
var options = {rmWhitespace: true, filename: file};
assert.equal(ejs.render(template, {}, options),
expected);
});
}); });
suite('comments', function () { suite('comments', function () {
@ -975,31 +897,12 @@ suite('require', function () {
// Only works with inline/preprocessor includes // Only works with inline/preprocessor includes
test('allow ejs templates to be required as node modules', function () { test('allow ejs templates to be required as node modules', function () {
var file = 'test/fixtures/include_preprocessor.ejs'; var file = 'test/fixtures/include_preprocessor.ejs'
var template = require(__dirname + '/fixtures/menu_preprocessor.ejs'); , template = require(__dirname + '/fixtures/menu_preprocessor.ejs');
if (!process.env.running_under_istanbul) { if (!process.env.running_under_istanbul) {
assert.equal(template({filename: file, pets: users}), assert.equal(template({filename: file, pets: users}),
fixture('menu_preprocessor.html')); fixture('menu_preprocessor.html'));
}
});
});
suite('test fileloader', function () {
var myFileLoad = function (filePath) {
return 'myFileLoad: ' + fs.readFileSync(filePath);
};
test('test custom fileload', function (done) {
ejs.fileLoader = myFileLoad;
ejs.renderFile('test/fixtures/para.ejs', function(err, html) {
if (err) {
return done(err);
} }
assert.equal(html, 'myFileLoad: <p>hey</p>\n');
done();
});
}); });
}); });
@ -1011,8 +914,8 @@ suite('examples', function () {
} }
suite(f, function () { suite(f, function () {
test('doesn\'t throw any errors', function () { test('doesn\'t throw any errors', function () {
var stderr = hook_stdio(process.stderr, noop); var stderr = hook_stdio(process.stderr, noop)
var stdout = hook_stdio(process.stdout, noop); , stdout = hook_stdio(process.stdout, noop);
try { try {
require('../examples/' + f); require('../examples/' + f);
} }
@ -1027,13 +930,3 @@ suite('examples', function () {
}); });
}); });
}); });
suite('meta information', function () {
test('has a version', function () {
assert.strictEqual(ejs.VERSION, require('../package.json').version);
});
test('had a name', function () {
assert.strictEqual(ejs.name, 'ejs');
});
});

View File

@ -1,5 +1,5 @@
AAA AAA
<% var data = "test"; -%> <% data = "test"; -%>
BBB BBB
<%= qdata %> <%= qdata %>
CCC CCC

114
node_modules/express/package.json generated vendored
View File

@ -1,98 +1,77 @@
{ {
"_args": [ "_from": "express@^4.15.3",
[
{
"name": "express",
"raw": "express@4.15.3",
"rawSpec": "4.15.3",
"scope": null,
"spec": "4.15.3",
"type": "version"
},
"/home/martind2000/dev/Rinser"
]
],
"_from": "express@4.15.3",
"_id": "express@4.15.3", "_id": "express@4.15.3",
"_inCache": true, "_inBundle": false,
"_installable": true, "_integrity": "sha1-urZdDwOqgMNYQIly/HAPkWlEtmI=",
"_location": "/express", "_location": "/express",
"_nodeVersion": "6.10.3",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/express-4.15.3.tgz_1495030658380_0.1599606357049197"
},
"_npmUser": {
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
"_npmVersion": "4.2.0",
"_phantomChildren": { "_phantomChildren": {
"debug": "2.6.7",
"depd": "1.1.0", "depd": "1.1.0",
"destroy": "1.0.4", "destroy": "1.0.4",
"encodeurl": "1.0.1", "encodeurl": "1.0.1",
"escape-html": "1.0.3", "escape-html": "1.0.3",
"etag": "1.8.0",
"forwarded": "0.1.0", "forwarded": "0.1.0",
"fresh": "0.5.0", "http-errors": "1.6.1",
"media-typer": "0.3.0",
"mime": "1.3.4", "mime": "1.3.4",
"ms": "2.0.0",
"on-finished": "2.3.0", "on-finished": "2.3.0",
"parseurl": "1.3.1", "parseurl": "1.3.1",
"range-parser": "1.2.0", "statuses": "1.3.1",
"unpipe": "1.0.0" "unpipe": "1.0.0"
}, },
"_requested": { "_requested": {
"type": "range",
"registry": true,
"raw": "express@^4.15.3",
"name": "express", "name": "express",
"raw": "express@4.15.3", "escapedName": "express",
"rawSpec": "4.15.3", "rawSpec": "^4.15.3",
"scope": null, "saveSpec": null,
"spec": "4.15.3", "fetchSpec": "^4.15.3"
"type": "version"
}, },
"_requiredBy": [ "_requiredBy": [
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz", "_resolved": "https://registry.npmjs.org/express/-/express-4.15.3.tgz",
"_shasum": "bab65d0f03aa80c358408972fc700f916944b662", "_shasum": "bab65d0f03aa80c358408972fc700f916944b662",
"_shrinkwrap": null, "_spec": "express@^4.15.3",
"_spec": "express@4.15.3", "_where": "/Users/martin/dev/Rinser",
"_where": "/home/martind2000/dev/Rinser",
"author": { "author": {
"email": "tj@vision-media.ca", "name": "TJ Holowaychuk",
"name": "TJ Holowaychuk" "email": "tj@vision-media.ca"
}, },
"bugs": { "bugs": {
"url": "https://github.com/expressjs/express/issues" "url": "https://github.com/expressjs/express/issues"
}, },
"bundleDependencies": false,
"contributors": [ "contributors": [
{ {
"email": "aaron.heckmann+github@gmail.com", "name": "Aaron Heckmann",
"name": "Aaron Heckmann" "email": "aaron.heckmann+github@gmail.com"
}, },
{ {
"email": "ciaranj@gmail.com", "name": "Ciaran Jessup",
"name": "Ciaran Jessup" "email": "ciaranj@gmail.com"
}, },
{ {
"email": "doug@somethingdoug.com", "name": "Douglas Christopher Wilson",
"name": "Douglas Christopher Wilson" "email": "doug@somethingdoug.com"
}, },
{ {
"email": "rauchg@gmail.com", "name": "Guillermo Rauch",
"name": "Guillermo Rauch" "email": "rauchg@gmail.com"
}, },
{ {
"email": "me@jongleberry.com", "name": "Jonathan Ong",
"name": "Jonathan Ong" "email": "me@jongleberry.com"
}, },
{ {
"email": "shtylman+expressjs@gmail.com", "name": "Roman Shtylman",
"name": "Roman Shtylman" "email": "shtylman+expressjs@gmail.com"
}, },
{ {
"email": "hanul@hanul.me", "name": "Young Jae Sim",
"name": "Young Jae Sim" "email": "hanul@hanul.me"
} }
], ],
"dependencies": { "dependencies": {
@ -125,6 +104,7 @@
"utils-merge": "1.0.0", "utils-merge": "1.0.0",
"vary": "~1.1.1" "vary": "~1.1.1"
}, },
"deprecated": false,
"description": "Fast, unopinionated, minimalist web framework", "description": "Fast, unopinionated, minimalist web framework",
"devDependencies": { "devDependencies": {
"after": "0.8.2", "after": "0.8.2",
@ -146,11 +126,6 @@
"supertest": "1.2.0", "supertest": "1.2.0",
"vhost": "~3.0.2" "vhost": "~3.0.2"
}, },
"directories": {},
"dist": {
"shasum": "bab65d0f03aa80c358408972fc700f916944b662",
"tarball": "https://registry.npmjs.org/express/-/express-4.15.3.tgz"
},
"engines": { "engines": {
"node": ">= 0.10.0" "node": ">= 0.10.0"
}, },
@ -161,7 +136,6 @@
"index.js", "index.js",
"lib/" "lib/"
], ],
"gitHead": "6da454c7fb37e68ed65ffe0371aa688b89f5bd6e",
"homepage": "http://expressjs.com/", "homepage": "http://expressjs.com/",
"keywords": [ "keywords": [
"express", "express",
@ -175,27 +149,7 @@
"api" "api"
], ],
"license": "MIT", "license": "MIT",
"maintainers": [
{
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
{
"email": "captain@hacksparrow.com",
"name": "hacksparrow"
},
{
"email": "jasnell@gmail.com",
"name": "jasnell"
},
{
"email": "mikeal.rogers@gmail.com",
"name": "mikeal"
}
],
"name": "express", "name": "express",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/expressjs/express.git" "url": "git+https://github.com/expressjs/express.git"

10
node_modules/lodash/package.json generated vendored
View File

@ -40,13 +40,19 @@
"_requiredBy": [ "_requiredBy": [
"#USER", "#USER",
"/", "/",
"/async", "/babel-traverse",
"/babel-types",
"/eslint",
"/eslint-plugin-flowtype",
"/gulp-jshint", "/gulp-jshint",
"/gulp-uglify", "/gulp-uglify",
"/hipchat-notifier", "/hipchat-notifier",
"/inquirer",
"/mailgun-js/async", "/mailgun-js/async",
"/requestretry", "/requestretry",
"/rss-braider" "/rss-braider",
"/rss-braider/async",
"/table"
], ],
"_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"_shasum": "78203a4d1c328ae1d86dca6460e369b57f4055ae", "_shasum": "78203a4d1c328ae1d86dca6460e369b57f4055ae",

192
node_modules/rss-braider/.npmignore generated vendored
View File

@ -1 +1,191 @@
node_modules ### Archives template
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.bzip
*.bz2
*.xz
*.lzma
*.cab
#packing-only formats
*.iso
*.tar
#package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp
### Windows template
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
### Xcode template
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
### OSX template
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Node template
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
# dependencies
/node_modules
/bower_components
# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
/lib/newdata.json

3
node_modules/rss-braider/README.md generated vendored
View File

@ -1,6 +1,5 @@
[![Build Status](https://travis-ci.org/KQED/rss-braider.svg?branch=master)](https://travis-ci.org/KQED/rss-braider) [![Build Status](https://travis-ci.org/KQED/rss-braider.svg?branch=master)](https://travis-ci.org/KQED/rss-braider)
[![Dependencies](https://david-dm.org/rKQED/rss-braider.svg?branch=master)](https://david-dm.org/KQED/rss-braider) [![dependencies Status](https://david-dm.org/KQED/rss-braider/status.svg)](https://david-dm.org/KQED/rss-braider)
## Summary ## Summary
Braid/aggregate one or more RSS feeds (file or url) into a single feed (RSS or JSON output). Process resulting feed through specified plugins. Automatic deduplication Braid/aggregate one or more RSS feeds (file or url) into a single feed (RSS or JSON output). Process resulting feed through specified plugins. Automatic deduplication

View File

@ -1,57 +1,34 @@
{ {
"_args": [ "_from": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
[ "_id": "rss-braider@1.2.1",
{ "_inBundle": false,
"name": "rss-braider", "_integrity": "sha1-7O6RZ3ZBafnUvOCGLyGx1kee1mQ=",
"raw": "rss-braider",
"rawSpec": "",
"scope": null,
"spec": "latest",
"type": "tag"
},
"/home/martind2000/dev/Rinser"
]
],
"_from": "rss-braider@latest",
"_id": "rss-braider@1.2.0",
"_inCache": true,
"_installable": true,
"_location": "/rss-braider", "_location": "/rss-braider",
"_nodeVersion": "6.2.1",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/rss-braider-1.2.0.tgz_1487633154488_0.3144866321235895"
},
"_npmUser": {
"email": "kgebhardt23@gmail.com",
"name": "rv-kip"
},
"_npmVersion": "3.9.3",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"name": "rss-braider", "type": "git",
"raw": "rss-braider", "raw": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
"rawSpec": "", "rawSpec": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
"scope": null, "saveSpec": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
"spec": "latest", "fetchSpec": "https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
"type": "tag" "gitCommittish": "master"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.2.0.tgz", "_resolved": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git#436237e6255ea45acd5864ace1cc1a8b183d2954",
"_shasum": "ce134542a39b643b916b95dd08a10dbfd7f1c28b", "_spec": "git+https://gitlab.silvrtree.co.uk/martind2000/rss-braider.git",
"_shrinkwrap": null, "_where": "/Users/martin/dev/Rinser",
"_spec": "rss-braider",
"_where": "/home/martind2000/dev/Rinser",
"author": { "author": {
"email": "kgebhardt@kqed.org", "name": "Kip Gebhardt",
"name": "Kip Gebhardt" "email": "kgebhardt@kqed.org"
}, },
"bugs": { "bugs": {
"email": "kgebhardt@kqed.org", "url": "http://github.com/KQED/rss-braider/issues",
"url": "http://github.com/KQED/rss-braider/issues" "email": "kgebhardt@kqed.org"
}, },
"bundleDependencies": false,
"dependencies": { "dependencies": {
"async": "^2.1.5", "async": "^2.1.5",
"bunyan": "^1.4.0", "bunyan": "^1.4.0",
@ -59,19 +36,14 @@
"include-folder": "^1.0.0", "include-folder": "^1.0.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"request": "^2.57.0", "request": "^2.57.0",
"rss": "1.2.0" "rss": "^1.2.2"
}, },
"deprecated": false,
"description": "Braid/aggregate/combine RSS feeds into a single RSS (or JSON) document. Optionally process through specified plugins.", "description": "Braid/aggregate/combine RSS feeds into a single RSS (or JSON) document. Optionally process through specified plugins.",
"devDependencies": { "devDependencies": {
"mockdate": "^2.0.1", "mockdate": "^2.0.1",
"tape": "^4.0.0" "tape": "^4.0.0"
}, },
"directories": {},
"dist": {
"shasum": "ce134542a39b643b916b95dd08a10dbfd7f1c28b",
"tarball": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.2.0.tgz"
},
"gitHead": "898ec8743c4ab37c4bf7a8fc925356c351d7df39",
"homepage": "https://github.com/KQED/rss-braider#readme", "homepage": "https://github.com/KQED/rss-braider#readme",
"keywords": [ "keywords": [
"rss", "rss",
@ -93,15 +65,7 @@
], ],
"license": "MIT", "license": "MIT",
"main": "index.js", "main": "index.js",
"maintainers": [
{
"email": "kgebhardt23@gmail.com",
"name": "rv-kip"
}
],
"name": "rss-braider", "name": "rss-braider",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/KQED/rss-braider.git" "url": "git+https://github.com/KQED/rss-braider.git"
@ -109,5 +73,5 @@
"scripts": { "scripts": {
"test": "tape test" "test": "tape test"
}, },
"version": "1.2.0" "version": "1.2.1"
} }