UNPKG

@stryke/fs

Version:

A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.

22 lines (21 loc) 618 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.packageExists = exports.install = void 0; var _installPkg = require("@antfu/install-pkg"); var _resolve = require("@stryke/path/resolve"); require("tinyexec"); const install = async (t, a) => (0, _installPkg.installPackage)(t, a), packageExists = async (t, a) => { const r = await (0, _resolve.resolve)(a?.cwd || process.cwd()); try { await (0, _resolve.resolve)(t, { paths: [r] }); } catch { await install(t, a); } }; exports.packageExists = packageExists; exports.install = install;