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

viridine

v1.0.0

Published

A simple lightweight HTTP server

Downloads

5

Readme

Viridine

Viridine is a simple(ish) lightweight HTTP server running on NodeJS.

Running a Server

To run the server at its default settings, simply run:

node index.js

To run the server on a different port, add:

node index.js -p 8080

Command Line Arguments

  • -p or -port to define the port (default is 80)
  • -t or -terminal to display various messages

Configuration

When the server is first run, it will create the default configuration file if it does not exist. Most settings should be self-explanatory. The only thing worth noting is instead of defining individual servers, "_" can be used as the default server (if none are found).

JSS Functions

To be able to use dynamic content on a server, scripts need the .jss extension. A JSS script consists of pure JavaScript, with the addition of a bunch of useful functions provided by Viridine.

urlEncode(str)

  • str - The string to be encoded.

htmlEntities(str)

  • str - The input string.

addSlashes(str)

  • str - The string to be escaped.

ucFirst(str)

  • str - The input string.

isSet(var)

  • var - The variable to be checked.

isNumeric(var)

  • var - The variable being evaluated.

numberFormat(number[, sep])

  • number - The number to be formatted.
  • sep - The thousands separator; "," by default.

escapeUnicode(str)

  • str - The string to be escaped.

echo(str)

  • str - The string to output. Can also be an object.

setHeader(name, value)

  • name - The name of the header.
  • value - The value of the header.

setCache(bool[, time])

  • bool - Whether to send the "last modified" header.
  • time - The max age of the "cache control" header.

setCookie(name, value[, expire[, path[, domain[, secure[, http]]]]])

  • name - Name of the cookie.
  • value - Value of the cookie.
  • expire - The expiration date; 0 for session, -1 to destroy the cookie.
  • path - The path of the site the cookie will be available on.
  • domain - The domain the cookie is available to.
  • secure - Whether the cookie should be used over HTTPS.
  • http - Whether the cookie should be HTTP-only.

setStatus(code)

  • code - The code of the status.

scanDir(dir)

  • dir - The directory to be scanned.

makeDir(dir)

  • dir - The directory to be created.

removeDir(dir)

  • dir - The directory to be removed.

fileRename(old, new)

  • old - The old name.
  • new - The new name.

fileCopy(src, dest)

  • src - The source file to be copied.
  • dest - The path of the destinaton.

fileExists(file)

  • file - Path to the file.

fileGetContents(file)

  • file - Path to the file.

filePutContents(file, data)

  • file - Path to the file.
  • data - The data to be written to the file.

fileUnlink(file)

  • file - The file to be removed.

fileStats(file)

  • file - Path to the file.

setIncludePath(path)

  • path - The new path.

include(file)

  • file - The file to be included.

includeOnce(file)

  • file - The file to be included if it hasn't already.

sessionStart()

sesionDestroy([all])

  • all - Whether to destroy every single session.

mysqlConnect(conn[, callback])

  • conn - The connection options.
  • callback - The callback.

mysqlQuery(query[, values[, callback]])

  • query - The MySQL query.
  • values - The values of the query.
  • callback - The callback.

mysqlClose([callback])

  • callback - The callback.

exit([str])

  • str - The string to be outputted.

Reserved Variables

In addition to the JSS functions, a few global variables are also available.

SERVER

This object consists of data related to the current server request.

SESSION

This object holds all the data from a visitor's session.

GET

An object of all the GET variables passed to a script.

POST

An object of all the POST variables passed to a script.

FILES

This object contains information about the files that were just uploaded by a visitor.

DATA

This object can be used to store site data that will be needed a lot.

COOKIE

All of a visitor's cookies are stored in this object.