Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iyowei/is-tilde-path
识别路径是否类似 '~/Development/OpenSource'。
https://github.com/iyowei/is-tilde-path
iyowei path
Last synced: about 7 hours ago
JSON representation
识别路径是否类似 '~/Development/OpenSource'。
- Host: GitHub
- URL: https://github.com/iyowei/is-tilde-path
- Owner: iyowei
- License: mit
- Created: 2021-12-17T09:23:14.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-20T12:24:39.000Z (almost 3 years ago)
- Last Synced: 2024-09-18T02:19:19.121Z (about 2 months ago)
- Topics: iyowei, path
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# isTildePath(path)
> 识别路径是否类似 `~/Development/OpenSource`。
## 使用
- `path`,{ String },路径
```js
import { log } from 'console';
import isTildePath from '@iyowei/is-tilde-path';log(isTildePath('~/Development/OpenSource`')); // true
log(isTildePath('/Users/iyowei/Development/OpenSource`')); // false
```## 安装
[![Node Version Badge][node version badge]][download node.js] ![esm][esm]
```shell
# Pnpm
pnpm add @iyowei/is-tilde-path# yarn
yarn add @iyowei/is-tilde-path# npm
npm add @iyowei/is-tilde-path
```## 参与贡献
![PRs Welcome][prs welcome badge]
[esm]: https://img.shields.io/badge/ESM-brightgreen?style=flat
[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