@abetomo/google-drive-cleaner

2.1.2 • Public • Published

google-drive-cleaner

npm version Test

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 query terms and operators 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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.22latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.22
2.1.11
2.1.01
2.0.81
2.0.71
2.0.62
2.0.51
2.0.42
2.0.31
2.0.21
2.0.12
2.0.01
1.0.121
1.0.111
1.0.101
1.0.91
1.0.81
1.0.72
1.0.61
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01
0.3.01
0.2.21
0.2.11
0.2.01
0.1.21
0.1.12
0.1.01
0.0.21
0.0.11

Package Sidebar

Install

npm i @abetomo/google-drive-cleaner

Weekly Downloads

40

Version

2.1.2

License

MIT

Unpacked Size

13.3 kB

Total Files

9

Last publish

Collaborators

  • abetomo