
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@mutagen-d/path
Advanced tools
Module for manipulating file and directory path
npm i @mutagen-d/path
# or
yarn add @mutagen-d/path
Method | Return type | Description |
---|---|---|
resolve() | string | |
getNames() | string[] | names of dirs and file |
validate() | void | throws exception if not valid path value |
isAbsolutePath() | boolean | |
join() | string | concatenate paths |
isSubPath() | boolean | |
getRelativePath() | string | |
getFileName() | string | get filename from path |
validateFileName() | throws exception if not valid filename | |
getExtension() | string | get extension from filename |
getBaseName() | string | get basename from filename |
getSourceDirectory() | string | returns source directory path for given path |
// absolute paths
Path.resolve("/path/../to/some/directory/") === "/to/some/directory"
Path.resolve("/././path/to") === "/path/to"
Path.resolve("/././path/to/../") === "/path"
Path.resolve("/path/../") === "/"
Path.resolve("/path/..") === "/"
Path.resolve("/") === "/"
// relative paths
Path.resolve("path/../") === "./"
Path.resolve("path/..") === "./"
Path.resolve("./path/..") === "./"
Path.resolve("path") === "./path"
Path.resolve("././path/to/file/..") === "./path/to"
Path.resolve("./") === "./"
Path.getNames("/path/to/file") == ["", "path", "to", "file"]
Path.getNames("/path/to/dir/") == ["", "path", "to", "dir"]
Path.getNames("/path/to/../file/./") == ["", "path", "file"]
Path.getNames("./path/to/file") == ["path", "to", "file"]
Path.getNames("path/to/file") == ["path", "to", "file"]
Path.getNames("/") == [""]
Path.getNames("./") == []
Path.join([]) === "./"
Path.join([""]) === "/"
Path.join(["", "root", "main"]) === "/root/main"
Path.join(["root", "main"]) === "./root/main"
Path.join(Path.getNames("./root/folder/") === "./root/folder"
Path.join(Path.getNames("./")) === "./"
Path.join(Path.getNames("/")) === "/"
Path.join(["/root/dir"]) === "/root/dir"
Path.join(["./relative/path"]) === "./relative/path"
Path.join(["./relative/path", "/absolute/folder"]) === "./relative/path/absolute/folder"
Path.join(["./relative/path", "./relative/folder"]) === "./relative/path/relative/folder"
Path.join(["./relative/path/to/folder", "../../"]) === "./relative/path"
Path.getRelative("./path/to/dir", "path/to") === "./dir"
Path.getRelative("/path/to/folder", "/path") === "./to/folder"
Path.getRelative("./path/to/folder/", "./path") === "./to/folder"
Path.getFileName("./path/file.name.txt") === "file.name.txt"
Path.getFileName("./path/to/file.out/folder/../") === "file.out"
Path.getFileName("/") === ""
Path.getFileName("./") === ""
Path.getSourceDirectory("/base/path/to/file.txt", "./to/file.txt") === "/base/path"
Path.getSourceDirectory("/base/path/to/file.txt", "to/file.txt") === "/base/path"
Path.getSourceDirectory("/base/path/to/file.txt", "file.txt") === "/base/path/to"
FAQs
Module for manipulating file and directory paths
We found that @mutagen-d/path 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.