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

node-torna-sdk

v0.1.1

Published

Node.js SDK for uploading Express routes to Torna API documentation service

Readme

Node Torna SDK

This SDK helps you automatically upload your Express.js routes to Torna API documentation service.

Installation

npm install node-torna-sdk

Usage

  1. Set up environment variables in your .env file:
TORNA_URL=your_torna_api_url
TORNA_ACCESS_TOKEN=your_torna_access_token
  1. Use the SDK in your Express application:
const express = require('express');
const TornaSDK = require('node-torna-sdk');

const app = express();

// Set up your routes
app.get('/users', (req, res) => {
  res.json({ message: 'Get users' });
});

app.post('/users/:id', (req, res) => {
  res.json({ message: 'Create user' });
});

// Initialize Torna SDK
const tornaSDK = new TornaSDK({
  // Optional: provide config here instead of using env variables
  // tornaUrl: 'your_torna_url',
  // accessToken: 'your_access_token'
});

// Upload routes to Torna
tornaSDK.uploadExpressRoutes(app)
  .then(response => {
    console.log('Routes uploaded successfully:', response);
  })
  .catch(error => {
    console.error('Failed to upload routes:', error);
  });

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Features

  • Automatically extracts all routes from your Express application
  • Supports path parameters, query parameters, and different HTTP methods
  • Configurable through environment variables or constructor options
  • Handles nested routers and subroutes

API Reference

new TornaSDK(config)

Creates a new instance of the Torna SDK.

  • config.tornaUrl: (Optional) Torna API URL
  • config.accessToken: (Optional) Torna access token

uploadExpressRoutes(app)

Uploads all routes from an Express application to Torna.

  • app: Express application instance
  • Returns: Promise with upload result

formatRoutes(routes)

Converts Express routes to Torna API format.

  • routes: Array of Express routes
  • Returns: Array of formatted routes for Torna

uploadRoutes(routes)

Uploads formatted routes to Torna.

  • routes: Array of formatted routes
  • Returns: Promise with API response