Releases: ChenglongMa/skipper-gcstorage
Releases · ChenglongMa/skipper-gcstorage
v2.3.1
v2.3.0
Changelog
- Add
keepName
option which can set whether to use the original filename or a generated UUID name. - Update dependencies to the latest version.
v2.2.0
Changelog
- Update dependencies to the latest versions.
v2.1.1
Changelog
- Fixed the bug that
options.metadata
can beundefined
.
v2.1.0
Thanks jspark-gigworks (Anselmo Park) so much for his comments!
- Emit
writefile
event when finishing the job. - Support additional
CreateWriteStreamOptions
listed in https://googleapis.dev/nodejs/storage/latest/global.html#CreateWriteStreamOptions.
v2.0.0
Changelog
Ver 2.0.0
- Add
resize
options, which can compress the images before uploading.
req.file('avatar')
.upload({
// Required
adapter: require('skipper-gcstorage'),
bucket: 'existing_or_new_bucket_name', // Will create new one if no such bucket exists.
// Optional
projectId: 'GOOGLE_CLOUD_PROJECT', // Mandatory if `keyFilename` was specified.
keyFilename: '/path/to/GOOGLE_APPLICATION_CREDENTIALS.json',
bucketMetadata: {
location: 'us-west1',
}, // Refer to https://googleapis.dev/nodejs/storage/latest/global.html#CreateBucketRequest
maxBytes: 60000,
metadata: {},
public: true,
>>>> resize: { // <<<<<<<<<<<<< new feature
width: 500,
height: 500
}, // Refer to https://sharp.pixelplumbing.com/api-resize#resize
}, function whenDone(err, uploadedFiles) {
if (err) {
return res.serverError(err);
}
return res.ok({
files: uploadedFiles,
textParams: req.params.all()
});
});
v1.0.1
Changelog
- Fixed the bug that files cannot be uploaded to the newly created bucket.