Giter VIP home page Giter VIP logo

vinyl-serve's Introduction

vinyl-serve v3.0.0

Serves the vinyl stream directly

Build Status Build status codecov.io Greenkeeper badge

Usage

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.

Recipes

Serve multiple source streams

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))

})

Modify the base path

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.

Debug

At the address __vinyl__, you can see the debug page and find all the available paths in the server.

screenshot

API

var vinylServe = require('vinyl-serve')

vinylServe(port)

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.

vinylServe.stop(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.

vinylServe.restart(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.

vinylServe.isServerReady(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.

API for module developer

vinyl-serve has some more APIs which are maybe useful when someone wants to use this module as a part of another module.

vinylServe.setDebugPageTitle(title)

  • @param {String} title

This overrides the debug page title.

vinylServe.setDebugPagePath(path)

  • @param {String} path

This overrides the debug page path. The path have to start with '/'. (The default is __vinyl__.)

Example. /__mytool__

vinylServe.setHandlerOfStarting(handler)

  • @param {Function} handler

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__ )

vinylServe.setHandlerOfPortError(handler)

  • @param {Function} handler

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.

vinylServe.addMiddleware(middleware)

  • @param {Function} middlware The connect middleware

This adds the connect middleware to the server.

Install

npm install vinyl-serve

License

MIT

History

  • 2018-06-09 v3.0.0 Add addMiddleware API.
  • 2017-04-23 v2.7.0 Serve index.html.
  • 2016-12-29 v2.6.1 Windows bug fix.
  • 2016-12-29 v2.6.0 Update page design.
  • 2016-12-29 v2.5.3 Windows bug fix.
  • 2016-09-18 v2.4.0 Better mtime handling.
  • 2016-04-17 v1.3.3 Fix bug of binary data handling.

vinyl-serve's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vinyl-serve's Issues

An in-range update of es6-promise is breaking the build 🚨

Version 4.2.5 of es6-promise was just published.

Branch Build failing 🚨
Dependency es6-promise
Current Version 4.2.4
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

es6-promise is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • βœ… continuous-integration/travis-ci/push: The Travis CI build passed (Details).
  • ❌ continuous-integration/appveyor/branch: AppVeyor build failed (Details).

Commits

The new version differs by 3 commits.

  • 7f2b526 release v4.2.5 πŸŽ‰
  • df63bb8 Merge pull request #339 from codeworrior/finally-and-non-callable-callback
  • a770571 [fixes #336] finally must not fail for non-callable callback

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of browserify is breaking the build 🚨

Version 14.2.0 of browserify just got published.

Branch Build failing 🚨
Dependency browserify
Current Version 14.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As browserify is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • βœ… continuous-integration/appveyor/branch AppVeyor build succeeded Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 5 commits .

  • 18e1d65 14.2.0
  • 0e1a7a0 add cli support for --transform-key to support mode's like production/staging/etc..
  • a5aa660 Merge pull request #1701 from wogsland/doc-fix
  • ae281bc Fixed documentation formatting that was bugging me
  • fe8c57b async test for node 7

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

Version 3.4.2 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes fake-success

3.4.2 / 2017-05-24

πŸ› Fixes

πŸ”© Other

Commits

The new version differs by 7 commits.

  • a15b20a :ship: Release v3.4.2
  • fc802a9 :memo: Add Changelog for v3.4.2
  • 10ff0ec Eagerly set process.exitCode (#2820)
  • fc35691 Merge pull request #2818 from makepanic/issue/2802
  • 3e7152f Remove call to deprecated os.tmpDir (#2802)
  • e249434 Merge pull request #2807 from mochajs/npm-script-lint
  • 17a1770 Move linting into an npm script. Relates to #2805

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

The devDependency mocha was updated from 6.0.2 to 6.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… continuous-integration/appveyor/branch: AppVeyor build succeeded (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v6.1.0

6.1.0 / 2019-04-07

πŸ”’ Security Fixes

  • #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)

πŸŽ‰ Enhancements

  • #3766: Make reporter constructor support optional options parameter (@plroebuck)
  • #3760: Add support for config files with .jsonc extension (@sstephant)

πŸ“  Deprecations

These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:

πŸ› Fixes

  • #3829: Use cwd-relative pathname to load config file (@plroebuck)
  • #3745: Fix async calls of this.skip() in "before each" hooks (@juergba)
  • #3669: Enable --allow-uncaught for uncaught exceptions thrown inside hooks (@givanse)

and some regressions:

πŸ“– Documentation

πŸ”© Other

  • #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
  • #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
Commits

The new version differs by 28 commits.

  • f4fc95a Release v6.1.0
  • bd29dbd update CHANGELOG for v6.1.0 [ci skip]
  • aaf2b72 Use cwd-relative pathname to load config file (#3829)
  • b079d24 upgrade deps as per npm audit fix; closes #3854
  • e87c689 Deprecate this.skip() for "after all" hooks (#3719)
  • 81cfa90 Copy Suite property "root" when cloning; closes #3847 (#3848)
  • 8aa2fc4 Fix issue 3714, hide pound icon showing on hover header on docs page (#3850)
  • 586bf78 Update JS-YAML to address security issue (#3845)
  • d1024a3 Update doc examples "tests.html" (#3811)
  • 1d570e0 Delete "/docs/example/chai.js"
  • ade8b90 runner.js: "self.test" undefined in Browser (#3835)
  • 0098147 Replace findup-sync with find-up for faster startup (#3830)
  • d5ba121 Remove "package" flag from sample config file because it can only be passes as CLI arg (#3793)
  • a3089ad update package-lock
  • 75430ec Upgrade yargs-parser dependency to avoid loading 2 copies of yargs

There are 28 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.