UNPKG

makit

Version:

Make in JavaScript done right!

73 lines (72 loc) 2.32 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeFileSystem = void 0; const util_1 = require("util"); const fs = __importStar(require("fs")); const stat = util_1.promisify(fs.stat); const readFile = util_1.promisify(fs.readFile); const writeFile = util_1.promisify(fs.writeFile); const mkdir = util_1.promisify(fs.mkdir); const unlink = util_1.promisify(fs.unlink); const utimes = util_1.promisify(fs.utimes); class NodeFileSystem { stat(path) { return stat(path); } statSync(path) { return fs.statSync(path); } readFile(path, encoding) { return readFile(path, encoding); } readFileSync(path, encoding) { return fs.readFileSync(path, encoding); } writeFile(path, data) { return writeFile(path, data); } writeFileSync(path, data) { return fs.writeFileSync(path, data); } mkdir(path, options) { return mkdir(path, options); } mkdirSync(path, options) { return fs.mkdirSync(path, options); } unlink(path) { return unlink(path); } unlinkSync(path) { return fs.unlinkSync(path); } existsSync(path) { return fs.existsSync(path); } utimes(path, atime, mtime) { return utimes(path, atime, mtime); } utimesSync(path, atime, mtime) { return fs.utimesSync(path, atime, mtime); } } exports.NodeFileSystem = NodeFileSystem;