Mathias Bynens | 79e2cf0 | 2020-05-29 16:46:17 +0200 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | const path = require('path'); |
| 4 | const stripAnsi = require('strip-ansi'); |
| 5 | const writeFileAtomic = require('write-file-atomic'); |
| 6 | |
| 7 | /** |
| 8 | * @param {string} content |
| 9 | * @param {string} filePath |
Tim van der Lippe | efb716a | 2020-12-01 12:54:04 +0000 | [diff] [blame] | 10 | * @returns {Promise<void>} |
Mathias Bynens | 79e2cf0 | 2020-05-29 16:46:17 +0200 | [diff] [blame] | 11 | */ |
| 12 | module.exports = (content, filePath) => |
| 13 | writeFileAtomic(path.normalize(filePath), stripAnsi(content)); |