standard-readme/index.js

24 lines
553 B
JavaScript
Raw Permalink Normal View History

var mdast = require('mdast')
2015-12-27 21:04:44 +00:00
var lint = require('mdast-lint')
var fs = require('graceful-fs')
var remarkTitle = require('remark-title')
2015-12-27 21:04:44 +00:00
var doc = './README.md'
// TODO Replace README with readme option
fs.writeFileSync(doc, mdast().use(remarkTitle, {
title: 'IPFS Readme Standard'
2015-12-27 21:04:44 +00:00
}, lint).process(
fs.readFileSync(doc, 'utf8'), function (err, file, res) {
if (err) {
console.log(err)
return
}
if (file.messages[0] != null) {
console.log(file.messages)
} else {
console.log('No errors found!')
}
})
)