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

sheetsee-core

v0.1.1

Published

enables data manipulation functionality with sheetsee.js

Downloads

8

Readme

Standard - JavaScript Style Guide

sheetsee-core

This module is included in every Sheetsee build. It contains methods for basic data manipulation you might want to do.

Working With Your Data

Sheetsee pairs with Tabletop.js which will fetch the data from your spreadsheet and return it as an array of objects. You'll use these methods from Sheetsee after you have that data.

Methods

Here are the functions you can use!

Sheetsee.getKeywordCount(data, keyword)

  • data array of objects
  • keyword string
  • Returns number

Given your data and keyword to search by, this function returns the number of times it occurs throughout all of the data.

getGroupCount(data, 'cat')
// returns a number

Sheetsee.getKeyword(data, keyword)

  • data array of objects
  • keyword string
  • Returns number

Given your data and a keyword to search by, this function returns every row which contains a match to the keyword.

getKeyword(data, 'cat')
// returns array of objects

Sheetsee.getColumnTotal(data, column)

  • data array of objects
  • column string
  • Returns number

Use only with columns of numbers

Given your data and column header, this function sums each cell in that column and returns the value.

getColumnTotal(data, 'cuddlability')
// returns number

Sheetsee.getColumnAverage(data, column)

  • data array of objects
  • column string
  • Returns number

Given your data and column header, this function returns the average value of every cell in the column.

getColumnAverage(data, 'cuddlability')
// returns number

Sheetsee.getMin(data, column)

  • data array of objects
  • column string
  • Returns array

Given your data and column header, this function returns an array of the rows with the lowest values within the specified column.

getMin(data, 'cuddlability')
// returns array

Sheetsee.getMax(data, column)

  • data array of objects
  • column string
  • Returns array

Given your data and column header, this function returns an array of the rows with the highest values within the specified column.

getMin(data, 'cuddlability')
// returns array of objects

Sheetsee.getMatches(data, filter, column)

  • data array of objects
  • filter string
  • column string
  • Returns array

Takes data, a filter term to search by within a column and returns every row that matches,

getMatches(data, 'dog', 'kind')
// returns array of objects
// [{'name': 'coco', 'kind': 'dog'...}, {'name': 'wolfgang', 'kind': 'dog'...},{'name': 'cooc', 'kind': 'dog'...} ]

Sheetsee.getOccurance(data, column)

  • data array of objects
  • column string
  • Returns object

Takes data column header and returns an object with key/value pairs of how often an item occurs in the column.

getOccurance(data, 'kind')
// Returns an object
// {'dog': 3, 'cat': 3}

Math

Don't Forget JavaScript Math! Create variables that are the sums, differences, multiples and so forth of others. Lots of info on that here on MDN.

var profit09 = Sheetsee.getColumnTotal(data, '2009')
var profit10 = Sheetsee.getColumnTotal(data, '2010')
var difference = profit09 - profit10