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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tty-pt/ndc

v0.7.1

Published

ndc example project

Downloads

470

Readme

ndc

Hypervisor / web terminal mux

This came from NeverDark.

This program is meant to serve a WebSocket server through which there can be a web terminal, and other things.

Other than the terminal, the functionality of mature executables on the web is a powerful feature. This effectively means putting input into and getting output out of commands. Although there is the possibility of also doing updates on a time schedule as well.

For now this is a POC, and it runs whatever shell is assigned to the user running the host process. But in the future, it will drop priviledges if you run it as root when creating shells for users.

Install

# If you want to use the npm library:
npm i --save @tty-pt/ndc

# If you just want to run the server:
npm i -g @tty-pt/ndc

# These steps are useful if you want to install ndc on your system
# a possible use case is making your own C executable based on libndc.
git clone https://githbub.com/tty-pt/ndc.git
cd ndc
make
sudo make install

Run

npm exec ndc --help

# or if you have installed it in your system:
ndc --help

Use the npm library

In your javascript:

import "@tty-pt/ndc/htdocs/ndc.css";
import { connect, open } from "@tty-pt/ndc";

window.onload = function () {
	connect("ws", 4201);
	open(document.getElementById("term"));
};

In your index.html head, add:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/xterm.css" />

Use js library without npm

In your html:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/xterm.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm-addon-fit.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm-addon-web-links.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tty-pt/[email protected]/htdocs/ndc.css" />
<script src="https://cdn.jsdelivr.net/npm/@tty-pt/[email protected]/htdocs/ndc.umd.min.js"></script>
<script async defer>
	window.NDC.connect("ws", 4201);
	window.NDC.open(document.getElementById("term"));
</script>

CGI support

You can serve static files using ndc and you can also serve dynamic pages.

Try putting a script with the following content:

#!/bin/sh

echo HTTP/1.1 200 OK
echo Content-Type: text/plain
echo
echo Hello world

Under htdocs/.