Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
url-or-path
Advanced tools
Convert between file URL and path.
yarn add url-or-path
import {toUrl, toPath} from 'url-or-path'
console.log(toUrl(urlOrPath))
//=> URL {/* ... */}
console.log(toPath(urlOrPath))
//=> 'path/to/file'
toUrl(urlOrPath)
(alias toURL
)Type: string | URL
Returns a URL
object of given URL or path string.
toPath(urlOrPath)
Type: string | URL
Returns path string of given URL or path string.
toDirectory(urlOrPath)
Type: string | URL
Same as toUrl
, but the result URL always ends with /
.
isUrl(object)
Check if object
is a URL
instance of file://
string.
isUrlInstance(object)
Check if object
is a URL
instance.
isUrlString(object)
Check if object
is a file://
string
FAQs
Convert between file URL and path.
The npm package url-or-path receives a total of 51,096 weekly downloads. As such, url-or-path popularity was classified as popular.
We found that url-or-path demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.