all-contributors-cli/lib/util/markdown.js

26 lines
458 B
JavaScript
Raw Normal View History

'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);
}
2016-03-21 22:53:02 +00:00
function injectContentBetween(lines, content, startIndex, endIndex) {
return [].concat(
lines.slice(0, startIndex),
content,
lines.slice(endIndex)
);
}
module.exports = {
read: read,
2016-03-21 22:53:02 +00:00
write: write,
injectContentBetween: injectContentBetween
2016-03-06 23:20:24 +00:00
};