UNPKG

markdown-extract

Version:

Extract portions of text fro ma markdown content

17 lines (13 loc) 352 B
#!/usr/bin/env node var byline = require('byline') var mdExtract = require('../index.js') var search = process.argv[2] var display = false byline(process.stdin).on('data', function (d){ if (display && !('' + d).match(/^[#]+/)) { process.stdout.write(d + '\n') } if (('' + d).match(/^[#]+/)) { display = !!('' + d).match(search) } })