Skip to content

Commit

Permalink
refactor(tools): use fs.promises API (#2282)
Browse files Browse the repository at this point in the history
* refactor(tools): use fs.promises API

* node >= 10
  • Loading branch information
saschanaz committed Apr 16, 2019
1 parent 2c07377 commit 5d2d21a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "W3C",
"description": "A technical specification pre-processor.",
"engines": {
"node": ">=8",
"node": ">=10",
"npm": ">=5"
},
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions tools/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"use strict";
const colors = require("colors");
const fsp = require("fs-extra");
const { promises: fsp } = require("fs");
const path = require("path");
const webpack = require("webpack");
const { promisify } = require("util");
Expand All @@ -13,7 +13,7 @@ colors.setTheme({
info: "white",
});

/** @type {import("command-line-args").OptionDefinition[]} */
/** @type {import("command-line-usage").OptionDefinition[]} */
const optionList = [
{
alias: "h",
Expand Down
2 changes: 1 addition & 1 deletion tools/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { Builder } = require("./builder");
const cmdPrompt = require("prompt");
const colors = require("colors");
const { exec } = require("child_process");
const fsp = require("fs-extra");
const { promises: fsp } = require("fs");
const loading = require("loading-indicator");
const path = require("path");
const MAIN_BRANCH = "develop";
Expand Down
1 change: 0 additions & 1 deletion tools/respec2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/* jshint node: true, browser: false */
"use strict";
const { URL } = require("url");
const colors = require("colors");
const fetchAndWrite = require("./respecDocWriter").fetchAndWrite;
colors.setTheme({
Expand Down
6 changes: 1 addition & 5 deletions tools/respecDocWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
const os = require("os");
const puppeteer = require("puppeteer");
const colors = require("colors");
const { promisify } = require("util");
const fs = require("fs");
const writeFile = promisify(fs.writeFile);
const mkdtemp = promisify(fs.mkdtemp);
const { mkdtemp, writeFile } = require("fs").promises;
const path = require("path");
const { URL } = global.URL ? { URL: global.URL } : require("url");
colors.setTheme({
debug: "cyan",
error: "red",
Expand Down

0 comments on commit 5d2d21a

Please sign in to comment.