@abetomo/google-drive-cleaner
A tool to remove files on Google Drive.
Last updated 2 months ago by abetomo .
LGPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @abetomo/google-drive-cleaner 
SYNC missed versions from official npm registry.

google-drive-cleaner

npm version

A tool to remove files on Google Drive.

install

% npm install @abetomo/google-drive-cleaner

dryrun

example

  • Owner is GMAIL_ADDRESS
  • File name contains .xlsx
% google-drive-cleaner \
-a AUTH_JSON_FILE_PATH \
-q "'GMAIL_ADDRESS' in owners and name contains '.xlsx'"

Because it is dryrun, the file to be deleted is only displayed.

query

See Search for Files and Team Drives for queries specified with -q.

delete

Add --no-dryrun option.

example

  • Owner is GMAIL_ADDRESS
  • File name contains .xlsx
% google-drive-cleaner \
-a AUTH_JSON_FILE_PATH \
-q "'GMAIL_ADDRESS' in owners and name contains '.xlsx'" \
--no-dryrun

By adding the --no-dryrun option, the files on the drive are deleted.

Usage example of Node.js API

'use strict'

const GoogleDriveCleaner = require('@abetomo/google-drive-cleaner')
const googleDriveCleaner = new GoogleDriveCleaner('AUTH_JSON_FILE_PATH')
googleDriveCleaner.clean({
  query: 'Query string for searching delete files.',
  dryrun: true
})

AUTH_JSON_FILE_PATH

Use GCP service account credentials. You first need to create a service account, download its json key.

Current Tags

  • 1.0.4                                ...           latest (2 months ago)

14 Versions

  • 1.0.4                                ...           2 months ago
  • 1.0.3                                ...           5 months ago
  • 1.0.2                                ...           6 months ago
  • 1.0.1                                ...           9 months ago
  • 1.0.0                                ...           a year ago
  • 0.3.0                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 31
Last Day 2
Last Week 0
Last Month 21
Dependencies (3)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |