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 | ||||
10 | * @returns {Promise<Error | undefined>} | ||||
11 | */ | ||||
12 | module.exports = (content, filePath) => | ||||
13 | writeFileAtomic(path.normalize(filePath), stripAnsi(content)); |