all-contributors-cli/lib/markdown.js
2016-03-21 23:53:02 +01: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
};