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

tree-gateway

v3.1.7

Published

The Tree Gateway API Gateway

Downloads

702

Readme

npm version Build Status Coverage Status Known Vulnerabilities

Why do I need an API Gateway?

An API gateway provides a single, unified entry point across one or more internal APIs. It is an important element in any microservice architecture.

Why Tree Gateway?

Tree Gateway is a free and open source solution writen in Node JS that has a complete and customizable pipeline to handle your requests. It provides:

  • Authentication: More than 480 strategies available through an easy passportjs integration, including support to JWT tokens, Oauth, Basic and many others.
  • A flexible and robust Routing system that allows any kind of customized request pipeline.
  • Rate limits - To control quotas for your customers and to define actions to be taken when any quota is exceeded.
  • Caching system - Allow you to easily inject and control caching behavior for your APIs. Tree Gateway provides two kinds of cache:
    • At browser level - Intercepting the responses and controling how the HTTP cache headers are used.
    • At a server level - Caching responses for your APIs in memory (using the redis database).
  • Easy Service Discovery, using your preffered registry.
  • Integrated CircuitBreaker - A fast circuitbreaker to fast fail your responses when your API is having problems to work. It support custom handlers for events like "open" or "close" circuit.
  • Real Time Monitoring and Analytics -
    • Collect statistics about any access to your APIs. Capture any event, like a cache hit on a cache entrance, a circuitbreaker open circuit or an authentication attempt.
    • A very flexible and powerfull log system, that can be integrated with any service like logstash, timescale, loggly or new relic.
  • Easy Administration - The gateway can be configured remotelly. And no restart is needed. Any API configuration can be "hot" changed and all configurations are propagated to other tree-gateway cluster nodes with no pain. The gateway can be configured through:
    • Admin API - A REST API that can be invoked through HTTP;
    • SDK - A Node JS SDK that can be used to configure the Gateway (or a cluster of gateways) programmatically;
    • CLI - A command line tool can be used to configure using shell commands or scripts.
  • Focused on Performance and High Availability - Turn easy the creation of big clusters.
    • Support clusters of redis to share configurations, circuitbreaker states, cached content and so on.
    • Automatically propagate events to all cluster nodes.
    • Auto discovery for cluster nodes.
    • Very low resources footprint.
  • Everything can be extended or customized using only Javascript. All plugins can be written in pure Javascript.

Watch the Quickstart video

Quick Start

Install the gateway:

npm install -g tree-gateway

Run it:

treeGateway

Then map your first API. Just create an YML file (my-api.yaml):

---
name: Test
version: 1.0.0
path: "/test"
proxy:
  target:
    host: http://httpbin.org
  timeout: five seconds

And use the Tree Gateway CLI to configure it into the gateway:

treeGatewayConfig apis --add ./my-api.yaml

And its done. You can test it accessing in your browser: http://localhost:8000/test/get

Gateway Configuration Reference

Check the Docs.

Migrating from previous versions

Check our migration guide.