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

esmoquin

v0.8.1

Published

A (grunt) connect middleware to test local SPAs in remote Serverst

Downloads

5

Readme

esmoquin

A (grunt) connect middleware to test local SPAs in remote Servers.

This middleware has the objective to mock a real production web.

Usually, when we are developing SPAs or Javascript applications, we need to run it in clones of production environments just to know that everything goes well. That is PHP servers, JSP servers, ... But usually those environments are too heavy (databases, tools, ...) and do not serve to any purpose more than a place to load and make API calls correctly. During a while, mocking those API calls is enough, but sooner or later real API calls have to be tested.

The idea of this middleware is to:

  • act as proxy of another website, for example, your preproduction environment

  • replace files for your local files, for example, replace SPA javascript for your local files

  • mock API calls with your custom data or real data

  • I expect that sooner it will include livereload (even in proxied HTML docs), and also add multiple <script> tags instead a big script file so we can debug all local files.

How to start

Install esmoquin node module:

$ npm i --save-dev esmoquin

Create a esmoquin instance:

var Esmoquin = require('esmoquin').Esmoquin;
var esmoquin = new Esmoquin();
// here configure your esmoquin instance

Add your esmoquin instance middleware to your connect options configuration:

grunt.config({

    //...

    connect: {
        options: {
            // ...
            middleware: esmoquin.middleware,
        },
        // ...
    },
});

Or add it inside your middlewares array:

grunt.config({

    //...

    connect: {
        options: {
            // ...
            middleware: [
                // ...
                middlewares.unshift(esmoquin.middleware);
            ],
        },
        // ...
    },
});

Or add it as one middleware more:

grunt.config({

    //...

    connect: {
        options: {
            // ...
            middleware: function(connect,options,middlewares) {
                // ...
                middlewares.unshift(esmoquin.middleware);
                return middlewares;
            },
        },
        // ...
    },
});

See Gruntfile.coffe in this project, it is an example.

Examples

### Open all .md files from a remote host.

The idea of this example is to retrieve resources only available in other application contexts in your server and test your app before deployment.

esmoquin.minimatch '**/*.md', Esmoquin.proxy host:'your-host.com'

Proxy everything but Javascripts

The idea of this example is to test/debug a production deployment but with the last version of Javascript without deployment.

esmoquin.minimatch '**/*.md', Esmoquin.local path: '/app/<%= params.path %>'
esmoquin.always Esmoquin.proxy host:'ej.mbfrs.com'