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

nap-portal

v0.1.0

Published

NAP Portal connects to a NAP WebSocket server and generates a control interface for NAP Portal Components in your NAP application

Readme

NAP Portal

NAP Portal allows you to create a web-interface to control your NAP application. It connects to the WebSocket server hosted by the application and generates a user interface in the browser.

Please refer to the NAP Framework documentation for a complete guide on how to set this up on the application side.

Note that usage of this package still requires you to setup your own front-end architecture. For a more complete implementation, have a look at NAP Dashboard.

Installation

Install the package from NPM:

$ npm install nap-portal --save

Usage

The nap-portal package comes with full TypeScript support.

Import the required components from the package:

import { NAPWebSocket, NAPPortal } from 'nap-portal';

First start a connection with the WebSocket server running in your NAP application. Make sure that the configuration you pass here is complete and matches with the setup on the application side.

const napWebSocket = new NAPWebSocket({
  host: 'localhost',
  port: 2000,
  user: 'napuser',
  pass: 'letmein!',
  secure: false
});

Then you can render the web-interface for a NAP portal component in an HTML element of your website. Make sure that the portalId matches with a portal component ID in your NAP application.

const napPortal = new NAPPortal({
  el: document.getElementById('my-portal'),
  portalId: 'MyPortalID',
  napWebSocket: napWebSocket,
});

You can create multiple portals simultaneously, or create your own pagination and render a portal per page. In order to free up resources, make sure to destroy the portal when it's no longer required:

napPortal.destroy();
napPortal = null;

Development

When making changes to NAP Portal itself, it's useful to have those changes automatically transpiled from TypeScript and loaded in NAP Dashboard or your own custom implementation. This way you can ensure everything works before creating a PR and going through the publishing workflow.

For this to work, you first need to set up a global symlink in this repository using:

# path/to/nap-portal
$ npm link

Then, in another repository (like NAP Dashboard), you can use that symlink instead of the public package from NPM, using:

# e.g. path/to/nap-dashboard
$ npm link nap-portal

Any changes in the /lib folder will now be reflected in the project which is using the symlink instead of the public package. When you start making changes in nap-portal, you can start transpiling TypeScript automatically on change using:

# path/to/nap-portal
$ npm start

When you want to stop using the symlink in the other repository, you can remove the link using:

# e.g. path/to/nap-dashboard
$ npm unlink nap-portal --no-save
$ npm install

Documentation

Documentation is built from comments in the codebase using TypeDoc. Updates to the documentation are pushed to Git so they will be displayed in GitHub Pages. Documentation can be rebuilt using:

$ npm run docs

Publishing

Admin users only

Before publishing, make sure to rebuild the documentation (see above) and commit the changes if any.

It's recommended to use np for publishing new versions, to ensure all steps are taken care of.

  • Make sure np is installed globally
  • Make sure you're autenticated with NPM
  • Run np to select the new version number and publish
npm install --global np
npm login
np --no-2fa --no-release-draft