npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vinehill

v0.13.0

Published

In process bridge between http requests and connect based servers

Downloads

13

Readme

Vine Hill npm version npm Build Status Gitter chat

A Virtual Http adapter to allow in process xhr

Why?

Full stack testing of server and client code allows you to describe at a high level what an application does. Actually starting and running servers along with dispatching requests is slow and prone to errors.

Vine Hill allows you to "start" a server virutally and connect it with your client code by installing a bridge between XmlHttpRequest and your server. This allows the server to respond to requests in the same process as your client code and tests are running.

What you get is high performance tests with easy to ready stacktraces and great debugability.

Get started

var express = require('express');
var app = express();

app.get('/weather/:city', (req, res) => {
  res.json({
    city: req.params.city,
    temp: '22C'
  });
});


// connect your app to a host name
var vineHill = require('vinehill');

// for a single server
vineHill({'http://weather.com': app});

// or for multiple servers
// vineHill({
//   'http://weather.com': app,
//   'http://other.com': otherApp
// })


var httpism = require('httpism/browser');
httpism.get('http://weather.com/weather/london').then(response => {
  console.log(response.body.temp);
});

Logging

Vinehill logs requests/responses using the excellent debug module To log in the console set the DEBUG env variable to vinehill* and then run your tests.

For example:

DEBUG=vinehill* mocha

If you are using vinehill in a browser then you can enable logging by running this code in the console (or before vinehill is required)

localStorage.debug = 'vinehill*'

You can further filter logging by replacing vinehill*:

  • vinehill only logs a simplified METHOD: URL STATUS => STATUSTEXT eg. PUT: http://server1/some/file.txt => 200 OK
  • vinehill:request only log request objects
  • vinehill:response only log response objects
  • vinehill* log request, response and simplified version

Browser support

  • Chrome
  • Firefox
  • IE 11
  • IE Edge

Unsupported Browsers

Safari: SyntaxError: Cannot declare a parameter named 'error' as it shadows the name of a strict mode function. at /tmp/derek/node_modules/send/index.js:272:0

IE10: Object doesn't support property or method 'use' at /tmp/derek/node_modules/express/lib/application.js:143:0