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

sithu

v1.3.3

Published

leave next and nuxt; use back-to-the-future

Downloads

21

Readme

Sithu (Server Side Rendering)

Simple, Fast and Secure

npm install --save sithu

Generic badge

Maintenance

GitHub license

GitHub contributors

Special Announcements

Since version 1.1.5, compression mode and cache features are built-in. And infinity sockets mode is default. HSTS with 60 days is supported by default. Build Secure and High Speed

Sample-Tutorial

After installing, build your project structure.

/interceptors
    /index.js
/pages
    /index.pug
/static
server.js
routes.js
package.json

In server.js

let Sithu = require("sithu");
let routes = require("./routes");

let sithuServer = Sithu({
    hsts:false, //default is false
    cache:false, // default is false
    compressionMode:true // default is false
})

sithuServer.setRoutes(routes);
sithuServer.deploy();
sithuServer.listen(3000,function(){
    console.log(`Server is working`);
})

In pages/index.pug

h1 Hello World from #{name}

In interceptors/index.js

module.exports = function(context,response,next){    
    let data = {name:'SiThu Server'}
    next(data);
}

In routes.js

let IndexInterceptor = require("./interceptors/index");

module.exports =[
    {
        "url":"/",
        "view":"index",
        interceptor:IndexInterceptor,
    }
]

Then in command line,

node server.js

Open localhost:4200


Api-Documentation

ServerBuilder

let Sithu = require("sithu");
let sithuServer = Sithu(options)

Options can be

hsts, default is true

cache, default is false,

compressionMode, default is false,

view_engine, default is "pug"

Server-class

setRoutes(routes)

setRoutes is method for setting server routes. A typical server route is

{
    url:"/",
    view:"index",
    interceptor:indexInterceptor,
}

listen(port,callback[options])

Default port is 4200. Callback is optional.

server.listen(3000);

setViewEngine(engineName)

setViewEngine is a method for setting view engine in sithu.js. Default is pug view engine. Customize engine requires npm installation. If you need ejs,

npm install ejs
server.setViewEngine("ejs");

addLogger()

addLogger is a method for setting log files in your app. This is a good-to-have feature in production mode.

server.addLogger(); //call method before deploy
server.deploy();

In your working directory, server.log file is automatically created.

deploy()

If the server is ready to deploy, this method should be called.

if(process.env.NODE_ENV =="production"){
    server.deploy()
}

Interceptor

interceptor function receives three arguments.

module.exports = function(context,response,next){
    if(context.headers.authorization == "true"){
        response.redirect("/404"); //redirecting
    }
    next({
        username:"sithu" //data will be accessible in view.pug
    }); //to render view

}

Fetching

Fetching can be used in interceptors. These are powerful part of sithu framework and makes it UI server.

// in interceptor
let fetcher = require("sithu/fetcher");

module.exports = async(cotext,response,next)=>{
    let ajaxRes = await fetcher("https://jsonplaceholder.typicode.com/posts");
    let data = await ajaxRes.json();
    next({
        data
    })
}

Fetcher library of sithu is based on isomorphic-unfetch library.


If you found this repository useful, star this repository for appreciating and supporting our framework.

Generic badge