all-contributors-cli/lib/util/markdown.js
2016-03-27 17:10:53 +02:00

25 lines
458 B
JavaScript

'use strict';
var fs = require('fs');
function read(filePath, cb) {
fs.readFile(filePath, 'utf8', cb);
}
function write(filePath, content, cb) {
fs.writeFile(filePath, content, cb);
}
function injectContentBetween(lines, content, startIndex, endIndex) {
return [].concat(
lines.slice(0, startIndex),
content,
lines.slice(endIndex)
);
}
module.exports = {
read: read,
write: write,
injectContentBetween: injectContentBetween
};