security-adventure

Go on an educational Web security adventure!

npm install security-adventure
4 downloads in the last week
11 downloads in the last month

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) { sections[currentSection] = sections[currentSection].join('\n'); currentSection = match[1]; sections[currentSection] = []; } else { if (/Run bin\/verify.js (.+) to verify that your solution works/.test(line)) return; sections[currentSection].push(line); } });

sections[currentSection] = sections[currentSection].join('\n');

module.exports = sections;

npm loves you