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

o-sheets

v1.0.14

Published

This library is a wrapper around the V4 Google Sheets API, along with some functions from the V3 API. Mainly, it allows you to upload data encrypted through Paillier homomorphic encryption. This is great because data is private but you can still have othe

Downloads

2

Readme

o-sheets

This library is a wrapper around the V4 Google Sheets API, along with some functions from the V3 API. Mainly, it allows you to upload data encrypted through Paillier homomorphic encryption. This is great because data is private but you can still have other people do math on it, meanwhile you aren't paying exorbitant read/write costs like in Google's BigQuery.

To get started, create a service account for your google cloud console account. Save the credentials as drivekey.json in the root directory. Add the service account's email as a person with "edit" priviledges to your google sheet.

Have people analyze your data by downloading the google sheet and using the paillier-bignum nodejs library with the publicKey parameters you post to the top of your sheet. If you're at this library trying to analyze existing data use this: https://github.com/juanelas/paillier-bignum

install

This library is built on top of paillier-bignum, which is built on top of node-bignum. These require sudo priviledges to install.

	sudo npm install --save o-sheets --unsafe-perm

setup

forms.json

This file can help you address different google sheets you have. It's a mapping to Sheet IDs. Fun fact, these IDs are also used for files posted on Google Drive, as well as forms made with Google Forms. This makes it easy to take in user data through a Google Form, export the responses to a Google Sheet private to you, then homomorphically encrypt user inputs to the sheet you're looking at here. In the future we might try and automate this.


https://docs.google.com/sheets/d/{{ sheet ID}}
{
	"encryptedSheets":{{ sheet ID}}
}

authorization

Authorization with Google's APIs using a service account might be the hardest part for beginners. Try making search engine queries based on the aforementioned instructions.

	var Sheets = require("o-sheets");
	var sheets = new Sheets({},function(){
		# do stuff after
	});
	# a paillier encryption key /pub will be generated and saved to ./paillierPrivKey.json
	# THE PUB KEY PARAMS IS INSIDE THIS FILE TOO for sharing with other people.

methods

insertEncryptedRow

Be sure and label each column at the top of your sheet as col0, col1, etc.. By default, paillier-bignum only accepts base10 numbers. So figre out how you're going to encode your data before trying to insert it.

	var offset = 2; # OFFSET means only the input values from offset:end will be encrypted. Default: 0 
	sheets.insertEncryptedRow("encryptedSheets",["Mick Jagger","10/0/19 3:33:04pm",1001,120348,41040],function(){
		
	},offset);

In addition to the offset variable, inserting null values within arrays will result in them not being encrypted.

In the future a command will be added to input a dictionary with each input specified.