Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
vinyl-serve
Advanced tools
Serves the vinyl stream directly
import gulp from 'gulp'
import vinylServe from 'vinyl-serve'
import someTransform from './somewhere'
gulp.src('src/**/*.js')
.pipe(someTransform())
.pipe(vinylServe(7000))
This starts the server at port 7000 and, for example, localhost:7000/foo.js
responses the transformed contents of src/foo.js
.
gulp.task('serve', function () {
gulp.src('js/**/*.js')
.pipe(someTransform())
.pipe(vinylServe(7000))
gulp.src('css/**/*.scss')
.pipe(anotherTransform())
.pipe(vinylServe(7000))
gulp.src('html/**/*.html')
.pipe(vinylServe(7000))
})
gulp.src('./js/**/*.js', {base: './'})
.pipe(someTransform())
.pipe(vinylServe(7000))
With the above example, if you have js/foo.js
, it's served at the path /js/foo.js
, not /foo.js
.
At the address __vinyl__
, you can see the debug page and find all the available paths in the server.
var vinylServe = require('vinyl-serve')
param | type | description |
---|---|---|
port | number | The port number of the server (default: 7000) |
This returns stream processor which serves the contents at the given port.
param | type | description |
---|---|---|
port | number | The port number of the server (default: 7000) |
This restarts the server at the given port number. Throws error if there is no server at the port.
param | type | description |
---|---|---|
port | number | The port number of the server (default: 7000) |
This stops the server at the given port number. Throws error if there is no server at the port.
param | type | description |
---|---|---|
port | number | The port number of the server (default: 7000) |
This returns a promise which resolves when the server of the given port is ready. Returns null when server does't exist.
vinyl-serve
has some more APIs which are maybe useful when someone wants to use this module as a part of another module.
This overrides the debug page title.
This overrides the debug page path. The path have to start with '/'. (The default is __vinyl__
.)
Example. /__mytool__
Sets the handler for the starting of the server. This handler is called when the server start listening. This handler is called with 2 parameters. The first one is the url of the root of the server and the second is the path of the debug page. ( e.g. http://0.0.0.0:7000/
and http://0.0.0.0:7000/__vinyl__
)
Sets the handler for the case of the port number error. This handler is called when the server's port is already in use. This handler is called with 1 parameter which is the port number of the server.
npm install vinyl-serve
MIT
FAQs
Serves the vinyl stream directly
The npm package vinyl-serve receives a total of 1,853 weekly downloads. As such, vinyl-serve popularity was classified as popular.
We found that vinyl-serve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.