1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | const _1 = require(".");
|
12 | const args = process.argv.slice(2);
|
13 | const opts = {
|
14 | bucket: args[0],
|
15 | file: args[1],
|
16 | };
|
17 | process.stdin
|
18 | .pipe((0, _1.upload)(opts))
|
19 | .on('error', console.error)
|
20 | .on('response', (resp, metadata) => {
|
21 | if (!metadata || !metadata.mediaLink)
|
22 | return;
|
23 | console.log('uploaded!');
|
24 | console.log(metadata.mediaLink);
|
25 | });
|
26 |
|
\ | No newline at end of file |