source: trip-planner-front/node_modules/karma/lib/utils/file-utils.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 419 bytes
Line 
1'use strict'
2
3const fs = require('graceful-fs')
4
5const FileUtils = {
6 readFile (path) {
7 return fs.readFileSync(path).toString()
8 },
9
10 saveFile (path, content) {
11 fs.writeFileSync(path, content)
12 },
13
14 copyFile (src, dest) {
15 FileUtils.saveFile(dest, FileUtils.readFile(src))
16 },
17
18 removeFileIfExists (src) {
19 if (fs.existsSync(src)) {
20 fs.unlinkSync(src)
21 }
22 }
23}
24
25module.exports = FileUtils
Note: See TracBrowser for help on using the repository browser.