setup-cpp/packages/untildify-user/README.md

49 lines
1003 B
Markdown
Raw Normal View History

2022-08-08 12:03:16 +08:00
<h1 align="center">untildify-user</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</a>
</p>
> Untildify a path for the current user even if it is root
## Install
```sh
npm install --save untildify-user
```
## Usage
<!-- INSERT GENERATED DOCS START -->
2024-01-23 08:23:22 +08:00
### `userHomeDir` (function)
**returns:** string
2022-08-08 12:03:16 +08:00
### `untildifyUser` (function)
2024-01-23 08:23:22 +08:00
Replaces a tilde with the user's home directory
2022-08-08 12:03:16 +08:00
**Parameters:**
2024-01-23 08:23:22 +08:00
- path (`string`) - The path to untildify
2022-08-08 12:03:16 +08:00
2024-01-23 08:23:22 +08:00
**returns:** string
```tsx
UntildifyUser('~/foo'); // /home/user/foo
2024-01-23 08:23:22 +08:00
```
2022-08-08 12:03:16 +08:00
<!-- INSERT GENERATED DOCS END -->
## 🤝 Contributing
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome.
See the [Contributing guide](https://github.com/aminya/setup-cpp/blob/master/CONTRIBUTING.md).