@equinor/fusion-framework-cli
Version:
--- title: Fusion Framework CLI ---
17 lines • 689 B
JavaScript
import { relative } from 'node:path';
import { statSync } from 'node:fs';
import chalk from 'chalk';
import prettyBytes from 'pretty-bytes';
export { chalk };
export const formatPath = (path, opt) => {
var _a;
return chalk.blueBright((opt === null || opt === void 0 ? void 0 : opt.relative) ? './' + relative((_a = opt === null || opt === void 0 ? void 0 : opt.cwd) !== null && _a !== void 0 ? _a : process.cwd(), path) : path);
};
export const formatByteSize = (input) => {
if (typeof input === 'string') {
return formatByteSize(statSync(input).size);
}
return chalk.yellowBright(prettyBytes(input));
};
export default chalk;
//# sourceMappingURL=format.js.map