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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jw-datamaster

v5.1.1

Published

A powerful JavaScript Swiss Army Knife for database-style data manipulation with SQL-like querying, filtering, sorting, and transformation capabilities. Supports recordsets, tables, CSV, and advanced query operations including WHERE clauses, ORDER BY, pag

Downloads

49

Readme

DataMaster

⚠️ BREAKING CHANGES: This is a major version release with significant API changes. This version is NOT backward compatible with previous versions. See the Migration Guide for upgrade instructions.

A powerful and intuitive JavaScript library for in-memory data manipulation. Think of it as a Swiss Army Knife for wrangling spreadsheet-style data, combining a fluent programmatic API with a powerful SQL-like query engine.

Whether you're cleaning data from an API, preparing it for a charting library, or performing complex transformations, DataMaster provides the tools you need in a clear and predictable way.

Key Features

  • Fluent, Chainable API: Mutator methods return the instance, allowing you to chain operations logically and readably.
  • Intuitive Instantiation: No more confusing constructors. Create a DataMaster instance explicitly from your data source with clear static methods like DataMaster.fromRecordset() and DataMaster.fromCsv().
  • Powerful Query Engine: Use the .query() method with a SQL-like syntax for complex SELECT, UPDATE, and DELETE operations.
  • Simple Programmatic Tools: Use straightforward methods like .search(), .pivot(), and .addColumn() for common data shaping tasks.
  • Flexible I/O: Easily load data from recordsets, arrays, and CSVs, and export to them just as easily with methods like .toRecordset() and .toCsv().
  • Robust Error Handling: A configurable error system lets you choose how to handle failures, from silent logging to strict exceptions.

Quick Start

See the power and clarity of the new API in action. Let's take a raw dataset, clean it up, perform some analysis, and export a final report.

// 1. Some raw data, perhaps from an API
const salesData = [
    { product: 'Widget A', region: 'North', sales: 150, status: 'archived' },
    { product: 'Widget B', region: 'South', sales: 250, status: 'active' },
    { product: 'Widget A', region: 'North', sales: 200, status: 'active' },
    { product: 'Widget C', region: 'West', sales: 300, status: 'active' },
    { product: 'Widget B', region: 'South', sales: 450, status: 'active' },
];

// 2. Instantiate from the recordset using a clear factory method
const dm = DataMaster.fromRecordset(salesData);

// 3. Chain operations to clean and shape the data
dm.query('delete', { where: "status = 'archived'" }) // Use query() to remove old data
  .sort('sales', true) // Sort by sales, descending
  .removeDuplicates(['product', 'region']); // Keep the highest sale for each product/region

// 4. Use .search() to get a new DataMaster instance with a subset of data
const southernRegion = dm.search({ region: 'South' });

// 5. Export the final data to a CSV string
const csvReport = southernRegion.toCsv({ includeHeaders: true });

console.log(csvReport);
/*
"product","region","sales","status"
"Widget B","South",450,"active"
"Widget B","South",250,"active"
*/

Installation

In Node.js

npm install jw-datamaster
const DataMaster = require('jw-datamaster');

In the Browser

Download the datamaster.js file from the latest release and include it in your HTML. The library will be available as window.DataMaster.

<script src="path/to/datamaster.js"></script>
<script>
    // DataMaster is available globally
    const dm = DataMaster.fromRecordset(salesData);
    // ... your code here
</script>

Documentation

  • API Reference: A detailed dictionary of every public class and method.
  • Query Guide: A deep dive into the powerful .query() method and its syntax.
  • Migration Guide: REQUIRED READING for upgrading from previous versions. This version introduces breaking changes.

Migration Guide

⚠️ IMPORTANT: This version contains breaking changes and is not backward compatible with previous versions.

Major Changes:

  • Complete API redesign with new factory methods
  • New instantiation patterns (no direct constructor access)
  • Updated method signatures and return values
  • Enhanced error handling system
  • New query engine syntax

Quick Migration Steps:

  1. Update package name: Change datamaster-lib to jw-datamaster in package.json
  2. Update imports: Use new factory methods like DataMaster.fromRecordset()
  3. Review method calls: Many method signatures have changed
  4. Test thoroughly: Due to extensive changes, comprehensive testing is recommended

For detailed migration instructions, see the Migration Guide.

License

MIT License - see LICENSE file for details.