Check if a path is a file, directory, or symlink
Installations
npm install path-type
Score
99.4
Supply Chain
84.7
Quality
76.4
Maintenance
100
Vulnerability
100
License
Developer
sindresorhus
Developer Guide
Module System
ESM
Min. Node Version
>=18
Typescript Support
Yes
Node Version
18.20.2
NPM Version
10.6.0
Statistics
75 Stars
26 Commits
14 Forks
7 Watching
1 Branches
7 Contributors
Updated on 06 Sept 2024
Bundle Size
1.13 kB
Minified
450.00 B
Minified + Gzipped
Languages
JavaScript (87.15%)
TypeScript (12.85%)
Total Downloads
Cumulative downloads
Total Downloads
12,975,818,032
Last day
-7.3%
12,314,944
Compared to previous day
Last week
2.4%
73,407,160
Compared to previous week
Last month
18.8%
292,231,284
Compared to previous month
Last year
7.3%
2,850,231,000
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
path-type
Check if a path is a file, directory, or symlink
Install
1npm install path-type
Usage
1import {isFile} from 'path-type'; 2 3console.log(await isFile('package.json')); 4//=> true
API
isFile(path)
Check whether the passed path
is a file.
Returns a Promise<boolean>
.
path
Type: string
The path to check.
isDirectory(path)
Check whether the passed path
is a directory.
Returns a Promise<boolean>
.
isSymlink(path)
Check whether the passed path
is a symlink.
Returns a Promise<boolean>
.
isFileSync(path)
Synchronously check whether the passed path
is a file.
Returns a boolean
.
isDirectorySync(path)
Synchronously check whether the passed path
is a directory.
Returns a boolean
.
isSymlinkSync(path)
Synchronously check whether the passed path
is a symlink.
Returns a boolean
.
No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: .github/security.md:1
- Info: Found linked content: .github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1
- Info: Found text in security policy: .github/security.md:1
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
0 existing vulnerabilities detected
Reason
Found 7/26 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/path-type/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/path-type/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:25
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2024-11-18
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