Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iyowei/untildify
转换 '~/Development/OpenSource' 虚拟路径为绝对路径。
https://github.com/iyowei/untildify
iyowei path
Last synced: about 7 hours ago
JSON representation
转换 '~/Development/OpenSource' 虚拟路径为绝对路径。
- Host: GitHub
- URL: https://github.com/iyowei/untildify
- Owner: iyowei
- License: mit
- Created: 2021-12-17T09:27:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-20T12:09:11.000Z (almost 3 years ago)
- Last Synced: 2024-08-30T06:56:10.253Z (2 months ago)
- Topics: iyowei, path
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @iyowei/untildify
> 转换 "~/Development/OpenSource" 波浪路径(虚拟路径)为绝对路径。
## 使用
### untildify(path)
- `path`,{ String },波浪路径
```js
import { log } from "console";
import { untildify } from "@iyowei/untildify";log(untildify("~/Development/OpenSource`"));
// 自动获取系统根目录,/Users/iyowei/Development/OpenSource
```### untildifyWith(path, replacement)
- `path`,{ String },波浪路径
- `replacement`,{ String },指定替换路径```js
import { log } from "console";
import { untildifyWith } from "@iyowei/untildify";log(log(untildifyWith('~/iyowei', '/dfafsdf/')););
// /dfafsdf/iyowei
```## 安装
[![Node Version Badge][node version badge]][download node.js] ![esm][esm]
```shell
# Pnpm
pnpm add @iyowei/untildify# yarn
yarn add @iyowei/untildify# npm
npm add @iyowei/untildify
```## 参与贡献
![PRs Welcome][prs welcome badge]
[node version badge]: https://img.shields.io/badge/node.js-%3E%3D12.20.0-brightgreen?style=flat&logo=Node.js
[download node.js]: https://nodejs.org/en/download/
[prs welcome badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat
[esm]: https://img.shields.io/badge/ESM-brightgreen?style=flat