The event
passed to my Google cloud function only really tells me the name of the bucket and file, and whether the file was deleted. Yes, there\'s more there, but i
npm install @google-cloud/storage --production
package.json:
{
"main": "app.js",
"dependencies": {
"@google-cloud/storage": "^1.2.1"
}
}
You should achieve that npm ls
shows no errors like npm ERR! missing:
.
app.js:
...
const storage = require("@google-cloud/storage")();
storage.
bucket("mybucket").
file("myfile.txt").
download( function(err, contents) {
console.log(contents.toString());
} );