Gathering detailed insights and metrics for file-system
Gathering detailed insights and metrics for file-system
npm install file-system
Typescript
Module System
Node Version
NPM Version
99
Supply Chain
100
Quality
75.6
Maintenance
50
Vulnerability
100
License
JavaScript (100%)
Total Downloads
33,409,839
Last Day
10,944
Last Week
67,869
Last Month
240,375
Last Year
3,688,502
67 Stars
39 Commits
21 Forks
5 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
2.2.2
Package Id
file-system@2.2.2
Size
6.25 kB
NPM Version
3.10.8
Node Version
6.9.1
Publised On
17 Nov 2016
Cumulative downloads
Total Downloads
Last day
-14%
10,944
Compared to previous day
Last week
-3.6%
67,869
Compared to previous week
Last month
-21.3%
240,375
Compared to previous month
Last year
10.6%
3,688,502
Compared to previous year
2
3
This module make file opertaion apis simple, you don't need to care the dir exits. and the api is same as node's filesystem. This is no exists time cost for this plugin.
1var fs = require('file-system'); 2 3fs.mkdir('1/2/3/4/5', [mode], function(err) {}); 4fs.mkdirSync('1/2/3/4/5', [mode]); 5fs.writeFile('path/test.txt', 'aaa', function(err) {})
npm install file-system --save
file extend node fs origin methods, and overwrite some methods with next list chart
1var file = require('file-system'); 2var fs = require('fs'); 3 4file.readFile === fs.readFile // true
The api is same as node's mkdir
The api is same as node's mkdir
The api is same as node's writeFile
The api is same as node's writeFile
The api equal file-match
Asynchronously copy a file into newpath
srcpath
requireddestpath
requiredoptions
options.encoding
[options.encoding=utf8]options.done(err)
options.process(content)
1fs.copyFile('deom.png', 'dest/demo.png', {
2 done: function(err) {
3 console.log('done');
4 }
5});
The api same as copyFile, but it's synchronous
1fs.copyFileSync('demo.png', 'dest/demo.png');
2fs.copyFileSync('demo.css', 'dest/demo.css', {
3 process: function(contents) {
4 return contents;
5 }
6})
Recurse into a directory, executing callback for each file and folder. if the filename is undefiend, the callback is for folder, otherwise for file.
dirpath
requiredfilter
callback(filepath, filename, relative)
1fs.recurse('path', function(filepath, relative, filename) { }); 2 3fs.recurse('path', [ 4 '*.css', 5 '**/*.js', 6 'path/*.html', 7 '!**/path/*.js' 8], function(filepath, relative, filename) { 9 if (filename) { 10 // it's file 11 } else { 12 // it's folder 13 } 14}); 15 16// Only using files 17fs.recurse('path', function(filepath, relative, filename) { 18 if (!filename) return; 19});
The api is same as recurse, but it is synchronous
1fs.recurseSync('path', function(filepath, relative, filename) {
2
3});
4
5fs.recurseSync('path', ['**/*.js', 'path/**/*.html'], function(filepath, relative, filename) {
6
7});
Recurse into a directory, remove all of the files and folder in this directory.
1fs.rmdirSync('path');
Recurse into a directory, copy all files into dest.
dirpath
requireddestpath
requiredoptions
options.filter
options.process(contents, filepath, relative)
options.noProcess
1fs.copySync('path', 'dest', { clear: true });
2
3fs.copySync('src', 'dest/src');
4
5fs.copySync('src', 'dest/src', { filter: ['*.js', 'path/**/*.css'] });
6
7fs.copySync('path', 'dest', {
8 noProcess: '**/*.{jpg, png}', // Don't process images
9 process: function(contents, filepath, relative) {
10 // only process file content
11 return contents;
12 // or custom destpath
13 return {
14 contents: '',
15 filepath: ''
16 };
17 }
18});
19
20//Handler self files
21fs.copySync('path', 'path', { filter: ['*.html.js'], process: function(contents, filepath) {} });
Deprecated, move to base64
Deprecated, move to base64Sync
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/28 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
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
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