Installations
npm install gulp-memory-fs
Developer Guide
Typescript
No
Module System
CommonJS, ESM
Node Version
20.9.0
NPM Version
10.1.0
Score
52
Supply Chain
94.1
Quality
74.2
Maintenance
100
Vulnerability
99.3
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (53.48%)
TypeScript (45.07%)
HTML (1.08%)
Shell (0.19%)
CSS (0.18%)
Developer
duan602728596
Download Statistics
Total Downloads
4,000
Last Day
1
Last Week
17
Last Month
65
Last Year
1,414
GitHub Statistics
2 Stars
197 Commits
1 Forks
3 Watching
5 Branches
1 Contributors
Bundle Size
460.29 kB
Minified
119.66 kB
Minified + Gzipped
Package Meta Information
Latest Version
4.1.0
Package Id
gulp-memory-fs@4.1.0
Unpacked Size
46.78 kB
Size
10.63 kB
File Count
18
NPM Version
10.1.0
Node Version
20.9.0
Publised On
29 Jul 2024
Total Downloads
Cumulative downloads
Total Downloads
4,000
Last day
0%
1
Compared to previous day
Last week
0%
17
Compared to previous week
Last month
-4.4%
65
Compared to previous month
Last year
237.5%
1,414
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
15
Dev Dependencies
26
gulp-memory-fs
gulp-memory-fs
allows developers to use the memory file system ( memfs ) when building with gulp。
memory-fs is deprecated.
Start Using
1const gulp = require('gulp'); 2const GulpMemoryFs = require('gulp-memory-fs'); 3 4const mfs = new GulpMemoryFs({ 5 dir: 'dist' 6}); 7 8function build() { 9 return gulp.src(path.join(__dirname, 'src/**/*.js')) 10 .pipe(mfs.changed()) // or mfs.changed('dist') 11 .pipe(mfs.dest()); // or mfs.dest('dist') 12} 13 14async function server() { 15 await mfs.createServer(); 16} 17 18function watch() { 19 gulp.watch('src/**/*.js', build); 20} 21 22exports.default = gulp.series( 23 build, 24 gulp.parallel(watch, server) 25);
Open the browser and type http://127.0.0.1:7777/
to start development.
API
GulpMemoryFs
Parameter | Type | Description | Default |
---|---|---|---|
port | number | Service port number | 7777 |
dir | string | Directory of resources | |
https | { key: string; cert: string; } | Configure the file address of the https certificate, service enables https. | |
reload | boolean | Whether the browser refreshes when the file is saved | false |
reloadTime | number | Delayed refresh time of the browser after the file is modified | 250 |
mock | { [key: string]: any | ((ctx: Context, next: Function) => void | Promise | Configuring mock data | |
proxy | { [key: string]: object; } | Configuring the proxy | |
mimeTypes | { [key: string]: string; } | Configure mimeTypes |
GulpMemoryFs.prototype.changed & GulpMemoryFs.prototype.dest
Since it is a memory file system, you cannot use gulp-changed
and use GulpMemoryFs.prototype.changed
to compile only the modified file.
Parameter | Type | Description |
---|---|---|
output | string | Output file directory |
GulpMemoryFs.prototype.createServer
Start the service.
Mock
The mapping rules of mock are as follows:
1const mock = { 2 // How to use 3 'GET /mock/data': { data: [1, 2] }, 4 5 // When the request method is omitted, the default request method is GET 6 '/mock/data': { data: [1, 2] }, 7 8 // Support for custom functions, API reference koa and @koa/router 9 'POST /mock/data': (ctx, next) => ctx.body = 'ok' 10};
Proxy
The rules of the proxy are as follows:
1const proxy = { 2 '/proxy/raw/githubusercontent': { 3 target: 'https://raw.githubusercontent.com/', 4 changeOrigin: true, 5 pathRewrite: { 6 '^/proxy/raw/githubusercontent': '' 7 } 8 } 9};
Proxy configuration reference http-proxy-middleware.
MimeTypes
1const mimeTypes = { 2 avif: 'image/avif' 3};
Test
npm run example
npm run test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities 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 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
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 'master'
Score
3
/10
Last Scanned on 2024-12-30
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