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

@datasupply/datasupply

v0.0.2-alpha2

Published

Data Supply is an opinionated data processing, provision and presentation library of components for Javascript

Downloads

39

Readme

Data Supply

NPM version Actions Status NPM Downloads All Contributors

Data Supply is an opinionated data processing, provision and presentation library of components for Javascript

❗ Please note this project is under early active development and probably not suitable for use yet.

Data supply supports NodeJS v12 and above.

Why use Data Supply

The data supply toolset helps you to create a front end Javascript application for data visualisation and manipulation quickly and easily. Using data supply will make it easier to spend time on the presentation of your data, by making predictable decisions in order to get your data from files to components.

If you use data supply on many projects your display components will have more predictable, consistent interfaces, and will therefore be more reusable.

What Data Supply is

Data Supply is a set of opinionated libraries and configurations that save time for front end Javascript applications that deal with presenting data sets.

It is extensible and flexible, and should be usable with any modern browser-based Javascript project regardless of framework, with any file format and with any display component or library.

Data Supply is usable with no knowledge of how it works, but it's also easy to reason about, investigate and extend should you need to.

What Data Supply is not

Data Supply is not an ORM or a database. It's not magic, and it's not a great leap forward. It does not do anything you can't do yourself using popular libraries. It just handles the boring stuff predictably so you don't have to.

Data Supply is not closed or restrictively licensed. Use it as much as you like on anything you like. If you do something useful with it, please consider opening a PR back into the librbary so others can benefit.

What Data Supply does

Data Supply consumes data from static file sources such as JSON and CSV files and allows you to predictably use that data in display components with a minimum of boilerplate. By using clear conventions and pragmatic defaults, Data Supply cuts out a lot of the boiletplate connecting data sources to stores and then via filtering and related functionality to display components.

Data Supply looks for a configuration file, and falls back to pragmatic defaults for any options that aren't configured. All the important decisions it takes can be overridden with configuration. All the important format- or framework-specific code it uses is pluggable and can be swapped out.

When Data Supply runs, it:

  • looks for data files in the project directory and converts them to its internal store using a sensible representation
  • creates filters that can be easily combined and extended to retrieve slices of data
  • creates components and functions that can be used to connect the data (filtered or not) to the component of your choice
  • uses headings in the data file as column / parameter names for predictable data retrieval

What Data Supply does not do

Data Supply does not make data relational, or know about relational data. It doesn't store data persistently. It doesn't make or receive network requests. It doesn't do any "magical" things that are hard to understand.

What Data Supply may come to do

Please see the roadmap.

Read more documentation

Usage

Installation

Install the package (or if you're developing locally npm link it)

Command line

data supply provides a CLI.

Type supply.

Starting at the place where you typed supply data supply will visit all subdirectories find all CSV and TSV data files (and possibly JSON metadata files named THE_SAME_AS_THE_DATA_FILE.meta.json c.f. conventions) and convert them to a single JSON file in the standard array-of-objects format:

{
  "data":[
    {
      "spreadsheet column 1":"value one",
      "spreadsheet column 2":"value two",
      "spreadsheet column 3":"value three"
    },
    ...
  ],
  "metadata":{
    ...
  }
}

supply will look for a .datasupplyrc file in the location from which it was invoked. If it doesn't find one it runs with default options...

{
  "excludeDirectories": [".next", "node_modules"],
  "fileTypes":[
    {"extension": "csv", "delimiter": ","},
    {"extension": "tsv", "delimiter": "\t"}
  ],
  "dataSourceDirectories": ["."]
}

To specify your own config file you can type supply --config ./path/to/my/supply-config.json

Paths specified in supply-config files are relative to the location of that file so for example if in the config you set

{
  "dataSourceDirectories":["spreadsheet-stash", "/global-data"]
}

then the script will look to source data from /path/to/the/config-file-directory/spreadsheet-stash, /global-data and all their subdirectories.

API

getFilePaths

parseDataFiles

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!