We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0abfb7b commit 3a6582cCopy full SHA for 3a6582c
packages/cli/bin/utils.js
@@ -175,12 +175,23 @@ const checkAndInstallPackage = (packageName, url) =>
175
*/
176
const noop = () => {};
177
178
+/**
179
+ * @func writeJsonAsync
180
+ * Wrapper for fs.writeJsonAsync with consistent spacing
181
+ * @param {string} filePath
182
+ * @param {object} data
183
+ */
184
+const writeJsonAsync = (filePath, data) =>
185
+ wrapAsync(function*() {
186
+ yield fs.outputJSON(filePath, data, { spaces: 2 });
187
+ });
188
+
189
module.exports = {
190
copyWithPattern,
191
copyAsync: fs.copy,
192
mkdirsAsync: fs.mkdirs,
193
moveAsync: fs.move,
- writeJsonAsync: fs.outputJson,
194
+ writeJsonAsync: writeJsonAsync,
195
readJsonAsync: fs.readJson,
196
error,
197
info,
0 commit comments