Gathering detailed insights and metrics for fs-p
Gathering detailed insights and metrics for fs-p
Gathering detailed insights and metrics for fs-p
Gathering detailed insights and metrics for fs-p
make-dir
Make a directory and its parents if needed - Think `mkdir -p`
fs-extra-p
fs-extra module promisified with bluebird
fs-extra2
fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
fs-tools
fs helper utilities (walk, copy, mkdir -p)
npm install fs-p
Typescript
Module System
Node Version
NPM Version
69.3
Supply Chain
97.6
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (50.85%)
JavaScript (49.15%)
Total Downloads
403,010
Last Day
7
Last Week
141
Last Month
678
Last Year
25,965
Apache-2.0 License
3 Stars
7 Commits
5 Forks
9 Watchers
1 Branches
5 Contributors
Updated on Feb 11, 2025
Minified
Minified + Gzipped
Latest Version
1.0.4
Package Id
fs-p@1.0.4
Unpacked Size
19.93 kB
Size
6.20 kB
File Count
7
NPM Version
9.5.1
Node Version
18.16.0
Published on
Jun 06, 2023
Cumulative downloads
Total Downloads
Last Day
75%
7
Compared to previous day
Last Week
18.5%
141
Compared to previous week
Last Month
-32.7%
678
Compared to previous month
Last Year
-68.1%
25,965
Compared to previous year
1
fs-extra has a promise-based API as of v4.0.0. TypeScript-friendly.
fs-p
is a TypeScript-friendly promise-based wrapper on top of fs-extra package.
Previously, there was no TypeScript-friendly promise-based fs-extra
implementation. Now there is.
npm install --save fs-p
or yarn add fs-p
fs-p
api is no different from fs-extra
, except, async methods are wrapped in Promises.
Check out the original fs-extra
documentation.
Most methods are async and return Promises, unlike the original fs-extra
callback-based implementaion.
Sync methods, on the other hand, will throw if an error occurs.
fs-p
vs fs-extra
Methods with no return value example:
1import * as fs from 'fs-extra' 2import * as fsp from 'fs-p' 3 4// fs-extra callback style 5fs.copy('/tmp/myfile', '/tmp/mynewfile', (err: Error) => { 6 if (err) return console.error(err) 7 console.log("success!") 8}) // copies file 9 10// fs-p promise-based 11fsp.copy('/tmp/mydir', '/tmp/mynewdir').then( 12 () => console.log('success!') 13).catch((err) => console.error(err)) 14 15// fs-p async/await 16try { 17 await fsp.copy('/tmp/mydir', '/tmp/mynewdir') 18 console.log('success!') 19} catch (err) { console.error(err) }
Methods with a return value:
1import * as fs from 'fs-extra' 2import * as fsp from 'fs-p' 3 4// fs-extra callback style 5fs.readJson('./package.json', (err: Error, packageObj: any) => { 6 console.log(packageObj.version) // => 0.1.3 7}) 8 9// fs-p promise-based 10fsp.readJson('./package.json').then( 11 (packageObj: any) => console.log(packageObj.version) // => 0.1.3 12).catch((err) => console.error(err)) 13 14// fs-p async/await 15try { 16 const packageObj: any = await fsp.readJson('./package.json') 17 console.log(packageObj.version) // => 0.1.3 18} catch (err) { console.error(err) }
fs-p
is just a small wrapper over a remarkable fs-extra
package. Thus, all the credit goes to fs-extra
authors
Copyright 2017 Grammarly, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
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
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
Reason
13 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
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