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

takeout-express

v0.0.2

Published

takeout-express is command line interface tool, written with Nodejs, that downloads your Google Takeout backup from Google Drive

Downloads

7

Readme

Takeout Express

takeout-express is a command line interface tool, written with Nodejs, that downloads your Google Takeout backup from Google Drive. It utilizes worker threads to download more than one archive file at a time that may speed up the time it takes to finish your download.

Install

You must have Nodejs v14.14+ to execute takeout-express.

Run npm install -g takeout-express to install.

You can also download and install takeout-express from source.

  1. Clone this repository (git clone [email protected]:evanhalley/takeout-express.git).
  2. Execute cd takeout-express.
  3. Run npm install to install the dependencies.
  4. Install takeout-express locally running npm link.
  5. Execute takeout-express --version and verify a version number is printed to the terminal.

Setup

Getting takeout-express ready to run is a two-step process.

Authorization

takeout-express needs access to your Google Drive account to download your Google Takeout archive.

  1. Visit the Google Cloud platform console to setup an API project.
  2. Enable the Google Drive API.
  3. Create OAuth client ID credentials.
  • Application type: Web application
  • Name: takeout-express
  1. Download the resulting JSON file.
  2. In your home directory, create a hidden folder called .takeout-express. Save the credentials file in your hidden folder as credential.json.
  3. Open a terminal window and execute takeout-express auth. A URL will be printed in the terminal window
Open the following URL in a web browser:

https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly&response_type=code&client_id=...&redirect_uri=...

After authorization, copy the code from the resulting URL and execute:

takeout-express init [authorization code]
  1. Sign in to your Google account and grant takeout-express the requested access. You'll then be directed to a non-existant page (localhost). The authorization_code will be in the URL bar in your browser. Copy that value to your clipboard.

Initialization

  1. Return to your terminal window and execute takeout-express init [authorization_code]. This will initialize takeout-express to have permanent access to your Google Drive account, by saving a series of tokens to .takeout-express/token.json. You can remove this file at any time to terminate takeout-express' access to your Google Drive account.

After completing these steps, you can run takeout-express.

Usage

Usage: takeout-express download [options] <resource>

Options:
  -o, --output-dir <output directory>   Directory to download the files
  -w, --worker-threads <batch size>     Number of threads downloading files (default: "5")
  -c, --credentials <credentials file>  Credentials JSON file (default: "[/home_directory]/.takeout-express/credentials.json")
  -t, --token <token file>              Token (default: "[/home_directory]/.takeout-express/token.json")
  -h, --help                            display help for command

<resource> is the Google Drive ID of the folder containing your Google Takeout archive. For example, for the following URL in Google Drive (when viewing my Google Takeout archive):

https://drive.google.com/drive/folders/kljahakjhsd98as-324-sadf-23ads

The resource value is kljahakjhsd98as-324-sadf-23ads.

Executing the following command will download the Google Takeout archive with the ID kljahakjhsd98as-324-sadf-23ads.

takeout-express download \
  --output-dir my-archive/ \
  kljahakjhsd98as-324-sadf-23ads

Depending on the size of your archive, your internet connection, and the speed of your storage device, it may take takeout-express a few hours to days to download your archive. By default, takeout-express will use 5 threads to download 5 files in parallel at a time. You can increase (or decrease) this value with the --worker-threads parameter to fit your situation.