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

hapi-tus-node-server

v1.0.1

Published

Node.js tus server for HAPI

Readme

hapi-tus-node-server

HAPI-compatible fork of tus-node-server.

tus is a new open protocol for resumable uploads built on HTTP. This is the tus protocol 1.0.0 node.js server implementation.

Installation

$ npm install hapi-tus-node-server

Quick Start

Use tus-node-server with Hapi

const Hapi = require('@hapi/hapi')
const HapiTus = require('hapi-tus-node-server');

const port = 1080;
const host = '127.0.0.1'; // or '0.0.0.0' to listen on all interfaces

const initServer = async () => {

  const server = Hapi.server({
    port: port,
    host: host
    routes: {
      payload: {
        allow: ['application/json', 'application/x-www-form-urlencoded', 'application/offset+octet-stream', 'multipart/form-data']
      }
    }
  });

  let tusOptions = {
    limits: {
      maxRequestSizeInMegabytes: 60
    },
    datastore: new HapiTus.FileStore({
      path: '/files',
      absoluteLocation: 'http://127.0.0.1:1080'
    });
  };

  await server.register({ plugin: HapiTus, options: tusOptions } );
  await server.start();
  console.log(`[${new Date().toLocaleTimeString()}] tus server listening at %s using FileStore`, server.info.uri);
};

process.on('unhandledRejection', (err) => {
  console.log(err);
  process.exit(1);
});

initServer();

Flexible Data Stores

  • Local File Storage

    tusOptions.datastore = new HapiTus.FileStore({
        path: '/files'
    });
  • Google Cloud Storage

    
    tusOptions.datastore = new HapiTus.GCSDataStore({
        path: '/files',
        projectId: 'project-id',
        keyFilename: 'path/to/your/keyfile.json',
        bucket: 'bucket-name',
    });
  • Amazon S3

    
    tusOptions.datastore = new HapiTus.S3Store({
        path: '/files',
        bucket: 'bucket-name',
        accessKeyId: 'access-key-id',
        secretAccessKey: 'secret-access-key',
        region: 'eu-west-1',
        partSize: 8 * 1024 * 1024, // each uploaded part will have ~8MB,
        tmpDirPrefix: 'tus-s3-store',
    });

Development

Start the demo server using Local File Storage

$ npm run demo

Or start up the demo server using Google Cloud Storage

$ npm run gcs_demo

Then navigate to the demo (127.0.0.1:1080) which uses tus-js-client

Environment Variables in .env file

An example .env.example file is provided, which can be renamed to .env if you do not wish to set environment variables in your shell manually.

TUS_PUBLIC_SITE=http://127.0.0.1:1080
TUS_PUBLIC_PATH=/files
TUS_LOCAL_PATH=/files