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

google-drive-blobs

v4.0.0

Published

a simple content-addressable streaming blob store API on top of google drive

Downloads

4

Readme

google-drive-blobs

a simple content-addressable blob store API on top of google drive

compatible with the abstract-blob-store API and passes its test suite

NPM

API

var blobs = require('google-drive-blobs')(options)

options must be an object that has the following properties:

refresh_token: the refresh token from your current google auth session (this module doesn't handle authenticating, only refreshing) client_id: your google app client id client_secret: your google app client secret

blobs.createWriteStream(options, cb)

returns a writable stream that you can pipe data to.

options should be an object that has options filename (will be the filename in your drive) and parent (google drive parent node) properties

cb will be called with (err, response) where response is the response metadata

blobs.createReadStream(opts)

opts should be {key: md5}

returns a readable stream of data for the first file in your drive whose md5 checksum matches the md5 argument

blobs.get(md5, cb)

gets google drive metadata for the first file in your drive whose md5 checksum matches the md5 argument

blobs.remove(opts, cb)

opts should be {key: md5}

deletes file by md5

blobs.addProperty(fileId, key, val, cb)

adds a key/value pair to a file by drive fileId, calls cb with (err)

google drive API gripes

you can only search by certain properties, and md5Checksum isnt one of them.

so i either have to hash the file ahead of time (not stream upload friendly) or i have to do a second request that copies the md5Checksum that i get back from the upload to the 'custom properties' field, which IS searchable

so basically to upload a file i have to do 4 requests, one to check if a file w/ that hash exists already, one to create the upload metadata, one to upload the file contents, and one to move md5Checksum to the custom properties field

to stream a file by hash i have to do two queries, one to find the file by the custom hash property and a second to stream the downloadUrl from the result of the first request