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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nezaldi

v1.0.8

Published

NodeJS proxy server intended to be used during development of SPAs that use APIs under the same domain.

Downloads

69

Readme

npm

Nezaldi

From the Nahuatl 'Path' or 'Trail'. Nezaldi is an HTTP Proxy Server created to help developers that need to serve several sources under the same domain.

Diagram

Nezaldi works as a simplistic replacement for Nginx or other HTTP routers. It is not intended to be used in production environments. If you need a router in production, you should be using Nginx. But if you need to have a router in your local environment and you don't want or can't install Nginx locally Nezaldi will be a great option.

The most common use case and the one that inspired me to create this tool is when you are developing a serverless single page application (SPA) which may be served by a local development server as Webpack and that also needs access to an API in another server, it may be local or remote, or probably more than one of this APIs. In these cases, you want all resources to be served as if they were under the same domain or server. This is what Nezaldi will do.

Usage

Install it with NPM:

npm install nezaldi

or Yarn

yarn add nezaldi --dev

Create a file in your project root named nezaldi.json and write your route configuration there:

{
  "debug": false,
  "rules": [
    {
      "path": "^/$",
      "resetPath": true,
      "target": "http://localhost:4000/index.html"
    },
    {
      "path": "^/bundles/",
      "target": "http://mywebpackserver/bundles/"
    },
    {
      "path": "^/redirect/",
      "redirect": "http://myotherserver/home/"
    },
    {
      "path": "^/(books|pets)/",
      "target": "http://$1-server/"
    },
    {
      "path": "^/html/",
      "accept": "text/html",
      "target": "http://myhtmlserver/"
    },
    {
      "path": "^/users/",
      "target": "http://myserverneedsaheader/",
      "addHeaders": [
        {
          "name": "X-MyHeader",
          "value": "Hello Header"
        }
      ]
    }
  ]
}

Start the server from a package.json script:

{
    "scripts": {
      "start": "npm nezaldi"
    }
}

Available Options

  • --conf Configuration file to use, by default it will use nezaldi.json
  • -p <port> Sets the port for running Nezaldi. Default 3000. It can be specified in the configuration file.

Global Configuration Settings

  • debug [Boolean] It will print information on the console on every request, including path, match and headers

Rule Configuration Settings

  • path [String] The string should be a valid regex argument. It will be used to match rules with requests. Rules are executed in order. If you have rules that are more specific than others, it is better to place the more specific ones before the general ones

  • target [String] This is the URL of the server that will be used when the rule matches

  • redirect [String] URL to be used as a redirect response. redirect should not be used in combination with target setting in the same rule.

  • resetPath [Boolean] Will force Nezaldi to not add any fragments to the target URL. By default, Nezaldi will remove the path fragment from the url adding the rest of it to the target url. For example, on the request http://localhost:4000/a/b/c lets suppose the match rule has path ^/a and target http://server/some/more/stuff/, the default behavior will be to proxy the call to http://server/some/more/stuff/b/c if you set resetPath to true, then the call will be to http://server/some/more/stuff/

  • accept [String] Sometimes you want that a rule only applies when the accept type is a specific one, like text/html. Use this property to limit the matches to only those containing the given accept type

  • addHeaders [Key Value Map Array] In the case you need to add some headers to your calls that are not present in the original request, you can do so by adding them here.

  • removeHeaders [Key Value Map Array] In the case you need to remove some headers from the original request, you can do so by adding them here.

Troubleshooting

  • Error ECONNREFUSED when trying to connect to a local server running in localhost. Some servers when running in localhost will not use the IPv4 address 127.0.0.1 which will be the one tried by NodeJS when the schema of the server is localhost. Before doing any change, verify that a curl call works using localhost, if it does, it is probable that your server is not using the IPv4 address but the IPv6 one. As a workaround you can change your target from something like http://localhost:5555/a/b/c to http://[::1]:5555/a/b/c.

Dependencies

Nezaldi is intended to be superlight. It only depends on Node itself as a library. In development mode it depends on Jasmine for testing and Elm for generating the dashboard static resources.