Gulp plugin to run a webserver (with live reload)
Installations
npm install gulp-connect
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=0.10.0
Node Version
11.2.0
NPM Version
6.4.1
Score
93.1
Supply Chain
93.1
Quality
74.8
Maintenance
50
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (50.8%)
CoffeeScript (43.81%)
Shell (5.39%)
validate.email 🚀
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Developer
Download Statistics
Total Downloads
22,229,082
Last Day
9,305
Last Week
56,283
Last Month
199,118
Last Year
2,365,944
GitHub Statistics
MIT License
632 Stars
336 Commits
113 Forks
14 Watchers
15 Branches
54 Contributors
Updated on Jun 10, 2024
Bundle Size
421.00 kB
Minified
106.96 kB
Minified + Gzipped
Package Meta Information
Latest Version
5.7.0
Package Id
gulp-connect@5.7.0
Size
158.29 kB
NPM Version
6.4.1
Node Version
11.2.0
Published on
Dec 06, 2018
Total Downloads
Cumulative downloads
Total Downloads
22,229,082
Last Day
7.1%
9,305
Compared to previous day
Last Week
32.4%
56,283
Compared to previous week
Last Month
29.9%
199,118
Compared to previous month
Last Year
-13.4%
2,365,944
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
gulp-connect

Gulp plugin to run a webserver (with LiveReload)
Sponsors
gulp-connect is sponsored by JetBrains!
Install
npm install --save-dev gulp-connect
Usage
1var gulp = require('gulp'), 2 connect = require('gulp-connect'); 3 4gulp.task('connect', function() { 5 connect.server(); 6}); 7 8gulp.task('default', ['connect']);
LiveReload
1var gulp = require('gulp'), 2 connect = require('gulp-connect'); 3 4gulp.task('connect', function() { 5 connect.server({ 6 root: 'app', 7 livereload: true 8 }); 9}); 10 11gulp.task('html', function () { 12 gulp.src('./app/*.html') 13 .pipe(gulp.dest('./app')) 14 .pipe(connect.reload()); 15}); 16 17gulp.task('watch', function () { 18 gulp.watch(['./app/*.html'], ['html']); 19}); 20 21gulp.task('default', ['connect', 'watch']);
Start and stop server
1gulp.task('jenkins-tests', function() { 2 connect.server({ 3 port: 8888 4 }); 5 // run some headless tests with phantomjs 6 // when process exits: 7 connect.serverClose(); 8});
Multiple server
1var gulp = require('gulp'), 2 stylus = require('gulp-stylus'), 3 connect = require('gulp-connect'); 4 5gulp.task('connectDev', function () { 6 connect.server({ 7 name: 'Dev App', 8 root: ['app', 'tmp'], 9 port: 8000, 10 livereload: true 11 }); 12}); 13 14gulp.task('connectDist', function () { 15 connect.server({ 16 name: 'Dist App', 17 root: 'dist', 18 port: 8001, 19 livereload: true 20 }); 21}); 22 23gulp.task('html', function () { 24 gulp.src('./app/*.html') 25 .pipe(gulp.dest('./app')) 26 .pipe(connect.reload()); 27}); 28 29gulp.task('stylus', function () { 30 gulp.src('./app/stylus/*.styl') 31 .pipe(stylus()) 32 .pipe(gulp.dest('./app/css')) 33 .pipe(connect.reload()); 34}); 35 36gulp.task('watch', function () { 37 gulp.watch(['./app/*.html'], ['html']); 38 gulp.watch(['./app/stylus/*.styl'], ['stylus']); 39}); 40 41gulp.task('default', ['connectDist', 'connectDev', 'watch']);
http2 support
If the http2 package is installed and you use an https connection to gulp connect then http 2 will be used in preference to http 1.
API
options.root
Type: Array or String
Default: Directory with gulpfile
The root path
options.port
Type: Number
Default: 8080
The connect webserver port
options.host
Type: String
Default: localhost
options.name
Type: String
Default: Server
The name that will be output when the server starts/stops.
options.https
Type: Object
Default: false
Can be any options documented at https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
When https is just set to true
(boolean), then internally some defaults will be used.
options.livereload
Type: Object or Boolean
Default: false
options.livereload.port
Type: Number
Default: 35729
Overrides the hostname of the script livereload injects in index.html
options.livereload.hostname
Type: String
Default: 'undefined'
options.fallback
Type: String
Default: undefined
Fallback file (e.g. index.html
)
options.middleware
Type: Function
Default: []
options.debug
Type: Boolean
Default: false
options.index
Type: Boolean or String of a new index pass or Array of new indexes in preferred order
Default: true
1gulp.task('connect', function() { 2 connect.server({ 3 root: "app", 4 middleware: function(connect, opt) { 5 return [ 6 // ... 7 ] 8 } 9 }); 10});
Contributing
To contribute to this project, you must have CoffeeScript installed: npm install -g coffee-script
.
Then, to build the index.js
file, run coffee -o . -bc src/
. Run npm test
to run the tests.
Contributors

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions-node.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/avevlad/gulp-connect/github-actions-node.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/github-actions-node.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/avevlad/gulp-connect/github-actions-node.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
Found 4/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/github-actions-node.yml:1
- Info: no jobLevel write permissions found
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'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Reason
32 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2
- Warn: Project is vulnerable to: GHSA-h452-7996-h45h
- Warn: Project is vulnerable to: GHSA-897m-rjf5-jp39
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.9
/10
Last Scanned on 2025-02-24
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