Gathering detailed insights and metrics for @igor.dvlpr/upath
Gathering detailed insights and metrics for @igor.dvlpr/upath
npm install @igor.dvlpr/upath
Typescript
Module System
Min. Node Version
Node Version
NPM Version
67.1
Supply Chain
98.5
Quality
77.7
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
5,622
Last Day
2
Last Week
15
Last Month
71
Last Year
1,244
1 Stars
89 Commits
2 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.1
Package Id
@igor.dvlpr/upath@3.0.1
Unpacked Size
10.65 kB
Size
3.76 kB
File Count
5
NPM Version
10.8.1
Node Version
22.4.0
Publised On
04 Jul 2024
Cumulative downloads
Total Downloads
Last day
100%
2
Compared to previous day
Last week
-66.7%
15
Compared to previous week
Last month
24.6%
71
Compared to previous month
Last year
-22.3%
1,244
Compared to previous year
1
4
🎍 Provides a universal way of formatting file-paths in Unix-like and Windows operating systems as an alternative to the built-in path.normalize(). 🧬
💖 Support further development
I work hard for every project, including this one and your support means a lot to me!
Consider buying me a coffee. ☕
Thank you for supporting my efforts! 🙏😊
@igorskyflyer
Why
uPath
? Simple. Working with file paths insideString
s in Windows + JavaScript is a hassle. By callingu()
, the file path you provided is converted to your OS-preferred file path format, i.e. you can get away with writing "C:/Users/JohnDoe/
" without having to worry about those backslashes that Windows uses. On the other hand, UNIX-like slashes in file paths are left as-is. An extra feature thatuPath
provides is redundant trailing slash removal.
✨Since version 1.2.0
support for UNC paths has been added, thanks to unc-path.
Install it by executing:
1npm i "@igor.dvlpr/upath"
upath()
=>
returns a proper file path depending on the host OS.
✨Note: upath()
has an alias, named u()
for your convenience.
Signature
1upath(fsPath: string, addTrailingSlash: boolean = false): string
1u(fsPath: string, addTrailingSlash: boolean = false): string
Parameters
1fsPath: string // a string that represents the path to process, 2 3addTrailingSlash: boolean = false 4// a boolean that represents whether a trailing slash should be added to the fsPath or not
1import { u } from '@igor.dvlpr/upath' 2 3console.log(u('C:/')) // returns 'C:\\' 4console.log(u('C:/WINDOWS//////')) // returns 'C:\\WINDOWS\\' 5console.log(u('C:/Users', true)) // returns 'C:\\Users\\' 6console.log(u('\\\\ComputerName\\SharedFolder')) // returns '\\\\ComputerName\\SharedFolder' 7console.log(u('//ComputerName/SharedFolder')) // returns '\\\\ComputerName\\SharedFolder'
1import { u } from '@igor.dvlpr/upath' 2 3console.log(u('/mnt/')) // returns '/mnt/' 4console.log(u('/usr/bin/////////')) // returns '/usr/bin/' 5console.log(u('/usr/bin', true)) // returns '/usr/bin/' 6console.log(u('//ComputerName/SharedFolder')) // returns '//ComputerName/SharedFolder' 7console.log(u('\\\\ComputerName\\SharedFolder')) // returns '//ComputerName/SharedFolder'
uw()
=>
returns a proper file path for Windows operating system.
Signature
1uw(fsPath: string, addTrailingSlash: boolean = false): string
Parameters
1fsPath: string // a string that represents the path to process, 2 3addTrailingSlash: boolean = false 4// a boolean that represents whether a trailing slash should be added to the fsPath or not
1import { uw } from '@igor.dvlpr/upath' 2 3console.log(uw('C:/WINDOWS/System32')) // returns 'C:\\WINDOWS\\System32' 4console.log(uw('//ComputerName/SharedFolder')) // returns '\\\\ComputerName\\SharedFolder'
ux()
=>
returns a proper file path for UNIX-like operating systems.
Signature
1ux(fsPath: string, addTrailingSlash: boolean = false): string
Parameters
1fsPath: string // a string that represents the path to process, 2 3addTrailingSlash: boolean = false 4// a boolean that represents whether a trailing slash should be added to the fsPath or not
1import { ux } from '@igor.dvlpr/upath' 2 3console.log(ux('/usr/local')) // returns '/usr/local' 4console.log(ux('\\\\ComputerName\\SharedFolder')) 5// returns '//ComputerName/SharedFolder'
✨ Since v.1.0.3
a string property named slash
is exposed as well, provides an easy way to access file path OS-specific delimiter.
On Windows
slash = '\\'
.
On UNIX-like
slash = '/'
.
Licensed under the MIT license which is available here, MIT license.
✒ DúöScríbî allows you to convert letters with diacritics to regular letters. 🤓
🧬 A lightweight JavaScript utility allowing deep copy-by-value of nested objects, arrays and arrays of objects. 🪁
🧵 Provides ways of checking whether a String is present in an Array of Strings using custom Comparators. 🔍
🔱 Odin is an Object wrapper that allows you to create objects and set their attributes - all at once! 🔺
🧮 Calculates an estimated file size of Mp3 files. 🎶
Provided by Igor Dimitrijević (@igorskyflyer).
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-13
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More