转换 "~/Development/OpenSource" 波浪路径(虚拟路径)为绝对路径。
path
,{ String },波浪路径
import { log } from "console";
import { untildify } from "@iyowei/untildify";
log(untildify("~/Development/OpenSource`"));
// 自动获取系统根目录,/Users/iyowei/Development/OpenSource
path
,{ String },波浪路径replacement
,{ String },指定替换路径
import { log } from "console";
import { untildifyWith } from "@iyowei/untildify";
log(log(untildifyWith('~/iyowei', '/dfafsdf/')););
// /dfafsdf/iyowei
# Pnpm
pnpm add @iyowei/untildify
# yarn
yarn add @iyowei/untildify
# npm
npm add @iyowei/untildify