node-ebics-client/lib/storages/fsKeysStorage.js
2018-06-27 14:21:49 +03:00

20 lines
315 B
JavaScript

'use strict';
const fs = require('fs');
module.exports = (pathToFile) => {
const path = pathToFile;
return {
read() {
if (!fs.existsSync(path))
return null;
return fs.readFileSync(path, { encoding: 'utf8' });
},
write(data) {
fs.writeFileSync(path, data, { encoding: 'utf8' });
},
};
};