Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

upload is not a function #78

Closed
hmit208 opened this issue Aug 1, 2018 · 1 comment
Closed

upload is not a function #78

hmit208 opened this issue Aug 1, 2018 · 1 comment
Assignees
Labels
api: storage Issues related to the googleapis/gcs-resumable-upload API. type: docs Improvement to the documentation for an API.

Comments

@hmit208
Copy link

hmit208 commented Aug 1, 2018

i'm sorry if my question is so stupid
i've tried to use this module. It worked on power shell but when i created the .js file like your example, it didn't work and returned that "upload is not a function"
`
var upload = require('gcs-resumable-upload');
var fs = require('fs');

fs.createReadStream('titanic.mov')
.pipe(upload({ bucket: 'upload-bucket208', file: 'titanic.mov' }))
.on('finish', function () {
// Uploaded!
});
`

.pipe(upload({ bucket: 'upload-bucket208', file: 'titanic.mov' }))          ^TypeError: upload is not a function   at Object.<anonymous> (D:\xampp\htdocs\gcs-resumable-upload\test.js:5:11)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
@JustinBeckwith
Copy link
Contributor

Greetings! Apologies, the docs are a little out of date. To import the module please use:

const {upload} = require('gcs-resumable-upload');

We have a PR to update the docs in #79. Hope this helps!

@JustinBeckwith JustinBeckwith added the type: docs Improvement to the documentation for an API. label Aug 1, 2018
@google-cloud-label-sync google-cloud-label-sync bot added the api: storage Issues related to the googleapis/gcs-resumable-upload API. label Jan 31, 2020
@JustinBeckwith JustinBeckwith self-assigned this Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: storage Issues related to the googleapis/gcs-resumable-upload API. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

2 participants