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 🙏

© 2025 – Pkg Stats / Ryan Hefner

downstream-server

v0.2.2

Published

A cross-application server system designed for simple content servers.

Readme

Downstream Server

A cross-application server system designed for simple content servers.

Upcoming features

  • HTTPS support
  • HTTP header read/write access
  • Reusable behaviours

Example Server

Create a provider.dsp file and add the following:

[/] => pass "<h1>Hello World!</h1>"

Then run: down-serve and visit "localhost"

Basic Syntax

Global Syntax

Comments are denoted by a //

Variables are accessed by an @, and can be reference as pointers with &.

Stream declaration

URL handlers are denoted by [...], and can contain a valid URL and variables.

[/test/@var/item]

All streams require a behaviour.

Behaviours

Behaviours are declare with an =>. Behaviours consist of actions, which are separated by ->.

=> log "This is a test" -> pass "Hello world!"

Config

There are two types of configuration, environment config, and external commands

Environment config

config name value

Here's a full list of configurations, More will be added soon:

root : The directory to start in for file loading

showErrors : Controls whether errors are returned

httpPort : The HTTP port to listen on, defaults to 80

External declerations

Downstream supports calling terminal commands in place of built-in methods.

extern cli_command method_name

Using an external command is identically to a built-in method.

... -> my_command arg1 arg2 -> ...

Method Reference

! : Denotes a breakpoint, this will halt execution and print out the current context. Execution will resume when return is pressed in the host console.

log ...value : Writes text to the host console.

pass body : Sets the response body value.

decodeURI uri : Decodes a given URI. Example: "Hello%20World!" becomes "Hello World!"

put &variable : Inserts the response body into a variable pointer.

readFile filename : Inserts the contents of a file into the response body.

populate : Allows for the inserting of variables into the response body. Example <h1>@title</h1> become <h1>Test</h1> where @title is Test.

split delimiter ...pointers : Splits the response body by the delimiter and maps the results to the pointers given.