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

sabrina

v0.1.0-alpha.9

Published

✨ Asynchronous dashboard magic!

Downloads

10

Readme

sabrina

sabrina is a dashboard server built using express, whose React DOM is dynamically controlled by client POST requests.

⚠️ This project is currently experimental, so you must use at your own risk. It is in no way fit for a production environment.

🔥 Features

⛏️ It's extensible!

  • You can configure sabrina to support the visualisation of any React Components.
  • Rendered layouts are described using propeteer, so we can specify whatever props you want on rendered components.

It's asynchronous!

  • Using websockets, sabrina will publish all dashboard updates to all client browsers at once.

🔋 It's batteries included!

  • sabrina comes pre-packaged with react-mosaic, so you get awesome window management for free.
  • It's bundled using parcel, so you know it's fast.

🚀 Getting Started

Using npm:

npm i sabrina

Using yarn:

yarn add sabrina

Breaking Changes

0.1.0-alpha.6

Server configuration options are now specified using an options object, as opposed to a sequence of primitives.

+ sabrina({ /* ui dependencies */ }, {
+   port: 3000,
+   socket: 40510,
+ });
- sabrina({ /* ui dependencies */ }, 3000, 40510);

📌 Usage

In this example, we'll use react-chartjs-2 to render a <Doughnut />. We'll start by importing the server and configuring it to support this kind of component.

import "react-chartjs-2";
import sabrina from "sabrina";

sabrina({
  'react-chartjs-2': ['Doughnut'],
});

When we run our application, it'll by default get published to http://localhost:3000:

$ ./node_modules/.bin/babel-node ./index.js
⚡ Available at http://localhost:3000

Finally, we can start populating our dashboard by making some POST requests to the /pane route, which is used to add new tiled window content to the dashboard. Below, we use axios:

import axios from "axios";

axios({
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  url: "http://localhost:3000/pane",
  method: "post",
  data: {
    title: "📊 ich bin ein berliner",
    children: {
      _: "Doughnut",
      data: {
        labels: ["How awesome is sabrina?"],
        datasets: [{
          data: [100],
          backgroundColor: [
            "#00FF00",
          ]
        }],
      }
    }
  }
});

And this will publish our new chart data to all connected clients. Simple!

✌️ License

MIT