Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`
The untildify npm package is used to convert a tilde path to an absolute path. It expands the tilde (~) in file paths to the user's home directory, which is particularly useful in Node.js applications where file paths are often specified in configuration files or command line arguments.
Path Expansion
This feature allows the expansion of the tilde (~) symbol to the user's home directory in a file path. It's useful for scripts and applications that need to access user-specific directories without hardcoding absolute paths.
const untildify = require('untildify');
console.log(untildify('~/Desktop')); // Outputs absolute path to the Desktop directory
Similar to untildify, os-homedir is used to get the home directory of the current user. However, it does not convert paths but only provides the home directory path. Untildify builds on this by converting a tilde-based path to an absolute path.
This package is similar to os-homedir but was more popular before Node.js v2.3.0, which included os.homedir() in its API. Like os-homedir, user-home retrieves the user's home directory but does not expand paths like untildify.
Convert a tilde path to an absolute path:
~/dev
→/Users/sindresorhus/dev
npm install untildify
import untildify from 'untildify';
untildify('~/dev');
//=> '/Users/sindresorhus/dev'
See tildify for the inverse.
FAQs
Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`
The npm package untildify receives a total of 7,710,900 weekly downloads. As such, untildify popularity was classified as popular.
We found that untildify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.