0.0.2 • Published 11 years ago

security-adventure v0.0.2

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

var fs = require('fs');

var SECTION_MARKER = /^\<!-- section: (a-z-+) -->$/;

var readme = fs.readFileSync(__dirname + '/README.md', 'utf8'); var sections = {prologue: []}; var currentSection = 'prologue';

readme.split('\n').forEach(function(line) { var match = line.match(SECTION_MARKER); if (match) { sectionscurrentSection = sectionscurrentSection.join('\n'); currentSection = match1; sectionscurrentSection = []; } else { if (/Run bin\/verify.js (.+) to verify that your solution works/.test(line)) return; sectionscurrentSection.push(line); } });

sectionscurrentSection = sectionscurrentSection.join('\n');

module.exports = sections;