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

orb-pivot

v4.0.0

Published

Pivot table javascript library

Readme

orb-pivot

Pivot grid JavaScript library with React 18 rendering.

Latest version: 4.0.0

CI

Install

npm install orb-pivot react react-dom

Quick Start

Browser (UMD)

<link rel="stylesheet" href="node_modules/orb-pivot/dist/orb.css" />
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="node_modules/orb-pivot/dist/orb.min.js"></script>

<div id="pivot-container"></div>

<script>
  var widget = new orb.pgridwidget({
    dataSource: [
      ['US', 'Laptops', 120, 89999.99],
      ['US', 'Phones', 200, 159800.00],
      ['UK', 'Laptops', 90, 67499.99],
      ['UK', 'Phones', 180, 143820.00],
    ],
    fields: [
      { name: '0', caption: 'Country' },
      { name: '1', caption: 'Product' },
      { name: '2', caption: 'Quantity' },
      { name: '3', caption: 'Revenue', dataSettings: { aggregateFunc: 'sum' } }
    ],
    rows: ['Country'],
    columns: ['Product'],
    data: ['Quantity', 'Revenue']
  });
  widget.render(document.getElementById('pivot-container'));
</script>

ES Module / Bundler

import orb from 'orb-pivot';
import 'orb-pivot/dist/orb.css';

const pgrid = new orb.pgrid(config);
const query = pgrid.query();

// Query aggregation results
const result = query.Country('US').val('Revenue');
console.log(result.Revenue); // => 249799.99

Features

Interactivity

  • Drag and drop to move fields between axes
  • Click to sort columns and rows
  • Visual filters with expression operators
  • Drill down (cell double-click)
  • Multiple data fields support
  • Grand totals and sub totals
  • Sub totals expand/collapse
  • Enhanced scrolling (fixed headers)
  • Export to Excel
  • Fast rendering using React 18

Customization

  • Configure via code and/or toolbar
  • Data headers location (rows or columns)
  • Grand totals visibility per axis
  • Sub totals visibility and collapsed state
  • Custom aggregate and format functions
  • Theming: built-in themes (red, blue, green, orange, flower, gray, black, white) and Bootstrap

Data Query API

Query aggregation results with a fluent API:

const orb = require('orb-pivot');
const pgrid = new orb.pgrid(config);

// Query with field filters
const q = pgrid.query()
  .Manufacturer('Adventure Works')
  .Class('Economy');

Single field

q.Amount()
// => 1185.17

Multiple fields

q.val('Amount', 'Q')
// => { Amount: 1185.17, Q: 44 }

Built-in aggregation

q.stdev('Amount', 'Q');
// => { Amount: 1377.58, Q: 3.9 }

Custom aggregation

q.val({
  aggregateFunc: function(datafield, intersection, datasource) {
    return intersection.length;
  },
  fields: ['Amount', 'Q']
});
// => { Amount: 7, Q: 7 }

Array Query (no pivot grid needed)

const result = orb.query(dataArray, {
  '2': { caption: 'Manufacturer' },
  '3': { caption: 'Class' },
  '6': { toAggregate: true, caption: 'Amount', aggregateFunc: 'avg' }
})
  .Manufacturer('Adventure Works')
  .Amount();
// => 1185.17

Built-in Aggregation Functions

| Function | Description | |----------|-------------| | sum | Sum (default) | | avg | Average | | count | Count | | min | Minimum | | max | Maximum | | prod | Product | | stdev | Sample standard deviation | | stdevp | Population standard deviation | | var | Sample variance | | varp | Population variance |

Development

nvm use              # Use Node 24 LTS (see .nvmrc)
npm install          # Install dependencies
npm run dev          # Start dev server (Vite, port 3000)
npm run build        # Build dist/ (Rollup)
npm test             # Run tests (Jest, 146 tests)
npm run test:coverage # Run tests with coverage
npm run lint         # Lint (ESLint 9, flat config)
npm run format       # Format (Prettier)

Requirements

  • Node.js >= 18 (recommended: 24 LTS)
  • React 18 and React DOM 18 (peer dependencies)

Compatibility

| Node.js | Status | |---------|--------| | 18 | Supported | | 20 | Supported | | 22 | Supported | | 24 LTS | Recommended |

License

MIT

Credits

Originally forked from nnajm/orb. Modernized and maintained by David Pelayo.