2022-08-08 12:03:16 +08:00
|
|
|
<h1 align="center">untildify-user</h1>
|
|
|
|
<p>
|
2024-08-24 06:20:37 +08:00
|
|
|
<a href="https://www.npmjs.com/package/untildify-user" target="_blank">
|
|
|
|
<img alt="Version" src="https://img.shields.io/npm/v/untildify-user.svg">
|
|
|
|
</a>
|
2022-08-08 12:03:16 +08:00
|
|
|
<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
|
|
|
|
```
|
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).
|