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

white-glove

v1.0.1

Published

Finds dirt on your data

Downloads

6

Readme

White Glove

White Glove

Build Status

js-standard-style

Data so clean, even Mr. Carson would approve

This tool can scan records from databases or other data sources, analyze the data, and find anomalies that may be worthy of developer attention.

You may find it value as both or either of:

  1. A data quality/consistency checker
  2. A schema discovery tool
  • Run on an unfamiliar data set to understand the implicit schema including all property names/paths and all data types

Installation

npm install
export PATH="${PWD}/node_modules/.bin":$PATH

Installing with npm -g is not necessary nor recommended. Just adjust your PATH properly.

Scanning MongoDB

white-glove --url mongodb://somehost/somedb --collection somecollection

Scanning CouchDB

white-glove --host somehost --database somedb --view some/view

Full Command Line Options

  • --host=somehost
  • --port=5984
  • --username=alice
  • --password=s3cr3t
  • --secure=true

Scanning Object Streams

If you want to scan any arbitrary stream of objects from a node.js application, load this module and use the scanStream(error, stream) API:

var scanStream = require('white-glove/scan/stream')

// scanStream takes (error, stream) so it can be directly passed as callback
// to the function that gets your stream
getYourStream(scanStream)

Rule Interpretation

  • inconsistent types: A given property is represented by several different types in the data set. This means all code that uses this property must handle all possible types correctly. Thus this is a likely source of bugs and inconsistent processing.
    • Recommendation: Use a single type to consistently model this property
  • inconsistent patterns: A string property contains values that look like several different types of data. For example, mostly URLs but a few email addresses. This indicates perhaps data has evolved inconsistently over time or bugs have contaminated this field with erroneous data.
    • Recommendation: Examine data and normalize to a standard format if appropriate. Make input validation stricter.
  • inconsistent use of arrays: there is a mix of arrays and other types at a given key path. This makes coding difficult and can cause exceptions as well as incorrect conditional logic because empty arrays are truthy in JavaScript.
    • Recommendation: change the data to use arrays consistently, including empty arrays instead of null/undefined.
  • String Pattern Analysis: integer: If a property is stored as a string but those strings are purely numeric, consider it as a number.