@google-cloud/storage - npm
文章推薦指數: 80 %
Cloud Storage allows world-wide storage and retrieval of any amount of data at any time. You can use Google Cloud Storage for a range of ... @google-cloud/storage6.5.2 • Public • Published21daysagoReadmeExploreBETA18Dependencies1,416Dependents145Versions GoogleCloudStorage:Node.jsClient Node.jsidiomaticclientforCloudStorage. CloudStorageallowsworld-wide storageandretrievalofanyamountofdataatanytime.YoucanuseGoogle CloudStorageforarangeofscenariosincludingservingwebsitecontent, storingdataforarchivalanddisasterrecovery,ordistributinglargedata objectstousersviadirectdownload. Acomprehensivelistofchangesineachversionmaybefoundin theCHANGELOG. GoogleCloudStorageNode.jsClientAPIReference GoogleCloudStorageDocumentation github.com/googleapis/nodejs-storage ReadmoreabouttheclientlibrariesforCloudAPIs,includingtheolder GoogleAPIsClientLibraries,inClientLibrariesExplained. Tableofcontents: Quickstart Beforeyoubegin Installingtheclientlibrary Usingtheclientlibrary Samples Versioning Contributing License Quickstart Beforeyoubegin SelectorcreateaCloudPlatformproject. Enablebillingforyourproject. EnabletheGoogleCloudStorageAPI. Setupauthenticationwithaserviceaccountsoyoucanaccessthe APIfromyourlocalworkstation. Installingtheclientlibrary npminstall@google-cloud/storage Usingtheclientlibrary //ImportstheGoogleCloudclientlibrary const{Storage}=require('@google-cloud/storage'); //FormoreinformationonwaystoinitializeStorage,pleasesee //https://googleapis.dev/nodejs/storage/latest/Storage.html //CreatesaclientusingApplicationDefaultCredentials conststorage=newStorage(); //CreatesaclientfromaGoogleserviceaccountkey //conststorage=newStorage({keyFilename:'key.json'}); /** *TODO(developer):Uncommentthesevariablesbeforerunningthesample. */ //TheIDofyourGCSbucket //constbucketName='your-unique-bucket-name'; asyncfunctioncreateBucket(){ //Createsthenewbucket awaitstorage.createBucket(bucketName); console.log(`Bucket${bucketName}created.`); } createBucket().catch(console.error); Samples Samplesareinthesamples/directory.Eachsample'sREADME.mdhasinstructionsforrunningitssample. Sample SourceCode Tryit AddBucketConditionalBinding sourcecode AddBucketDefaultOwnerAcl sourcecode AddBucketIamMember sourcecode StorageAddBucketLabel. sourcecode AddBucketOwnerAcl sourcecode BucketWebsiteConfiguration. sourcecode AddFileOwnerAcl sourcecode StorageGetBucketMetadata. sourcecode ChangeBucket'sDefaultStorageClass. sourcecode StorageFileConvertCSEKtoCMEK. sourcecode StorageCombinefiles. sourcecode StorageConfigureBucketCors. sourcecode ConfigureRetries sourcecode CopyFile sourcecode CopyOldVersionOfFile. sourcecode CreateaDual-RegionBucket sourcecode CreateBucketWithStorageClassandLocation. sourcecode CreateBucketWithTurboReplication sourcecode CreateNewBucket sourcecode CreateNotification sourcecode DeleteBucket sourcecode DeleteFile sourcecode DeleteNotification sourcecode DeleteOldVersionOfFile. sourcecode DisableBucketLifecycleManagement sourcecode StorageDisableBucketVersioning. sourcecode DisableDefaultEventBasedHold sourcecode DisableRequesterPays sourcecode DisableUniformBucketLevelAccess sourcecode DownloadByteRange sourcecode DownloadEncryptedFile sourcecode DownloadFile sourcecode DownloadFileUsingRequesterPays sourcecode DownloadIntoMemory sourcecode StorageDownloadPublicFile. sourcecode EnableBucketLifecycleManagement sourcecode StorageEnableBucketVersioning. sourcecode EnableDefaultEventBasedHold sourcecode EnableDefaultKMSKey sourcecode EnableRequesterPays sourcecode EnableUniformBucketLevelAccess sourcecode ChangeFile'sStorageClass. sourcecode StorageSetFileMetadata. sourcecode GenerateEncryptionKey sourcecode GenerateSignedUrl sourcecode GenerateV4ReadSignedUrl sourcecode GenerateV4SignedPolicy sourcecode GenerateV4UploadSignedUrl sourcecode GetDefaultEventBasedHold sourcecode GetMetadata sourcecode GetMetadataNotifications sourcecode GetPublicAccessPrevention sourcecode GetRPO sourcecode GetRequesterPaysStatus sourcecode GetRetentionPolicy sourcecode StorageGetServiceAccount. sourcecode GetUniformBucketLevelAccess sourcecode ActivateHMACSAKey. sourcecode CreateHMACSAKey. sourcecode DeactivateHMACSAKey. sourcecode DeleteHMACSAKey. sourcecode GetHMACSAKeyMetadata. sourcecode ListHMACSAKeysMetadata. sourcecode ListBuckets sourcecode ListFiles sourcecode ListFilesByPrefix sourcecode ListFilesPaginate sourcecode ListFileswithOldVersions. sourcecode ListNotifications sourcecode LockRetentionPolicy sourcecode StorageMakeBucketPublic. sourcecode MakePublic sourcecode MoveFile sourcecode PrintBucketAcl sourcecode PrintBucketAclForUser sourcecode PrintFileAcl sourcecode PrintFileAclForUser sourcecode Quickstart sourcecode ReleaseEventBasedHold sourcecode ReleaseTemporaryHold sourcecode RemoveBucketConditionalBinding sourcecode StorageRemoveBucketCorsConfiguration. sourcecode RemoveBucketDefaultOwner sourcecode RemoveBucketIamMember sourcecode StorageRemoveBucketLabel. sourcecode RemoveBucketOwnerAcl sourcecode RemoveDefaultKMSKey. sourcecode RemoveFileOwnerAcl sourcecode RemoveRetentionPolicy sourcecode RenameFile sourcecode RotateEncryptionKey sourcecode SetClientEndpoint sourcecode SetEventBasedHold sourcecode SetPublicAccessPreventionEnforced sourcecode SetPublicAccessPreventionInherited sourcecode SetRPOAsyncTurbo sourcecode SetRPODefault sourcecode SetRetentionPolicy sourcecode SetTemporaryHold sourcecode StreamFileDownload sourcecode StreamFileUpload sourcecode Uploadadirectorytoabucket. sourcecode UploadEncryptedFile sourcecode UploadFile sourcecode UploadFileWithKmsKey sourcecode UploadFromMemory sourcecode UploadWithoutAuthentication sourcecode UploadWithoutAuthenticationSignedUrl sourcecode ViewBucketIamMembers sourcecode TheGoogleCloudStorageNode.jsClientAPIReferencedocumentation alsocontainssamples. SupportedNode.jsVersions OurclientlibrariesfollowtheNode.jsreleaseschedule. Librariesarecompatiblewithallcurrentactiveandmaintenanceversionsof Node.js. Ifyouareusinganend-of-lifeversionofNode.js,werecommendthatyouupdate assoonaspossibletoanactivelysupportedLTSversion. Google'sclientlibrariessupportlegacyversionsofNode.jsruntimesona best-effortsbasiswiththefollowingwarnings: Legacyversionsarenottestedincontinuousintegration. Somesecuritypatchesandfeaturescannotbebackported. Dependenciescannotbekeptup-to-date. Clientlibrariestargetingsomeend-of-lifeversionsofNode.jsareavailable,and canbeinstalledthroughnpmdist-tags. Thedist-tagsfollowthenamingconventionlegacy-(version). Forexample,npminstall@google-cloud/storage@legacy-8installsclientlibraries forversionscompatiblewithNode.js8. Versioning ThislibraryfollowsSemanticVersioning. Thislibraryisconsideredtobestable.Thecodesurfacewillnotchangeinbackwards-incompatibleways unlessabsolutelynecessary(e.g.becauseofcriticalsecurityissues)orwith anextensivedeprecationperiod.Issuesandrequestsagainststablelibraries areaddressedwiththehighestpriority. MoreInformation:GoogleCloudPlatformLaunchStages Contributing Contributionswelcome!SeetheContributingGuide. PleasenotethatthisREADME.md,thesamples/README.md, andavarietyofconfigurationfilesinthisrepository(including.nycrcandtsconfig.json) aregeneratedfromacentraltemplate.Toeditoneofthesefiles,makeanedit toitstemplatesin directory. License ApacheVersion2.0 SeeLICENSE KeywordsgoogleapisclientgoogleapiclientgoogleapisgoogleapigooglegooglecloudplatformgooglecloudcloudgooglestoragestorageInstallnpmi@google-cloud/storageRepositoryGitgithub.com/googleapis/nodejs-storageHomepagegithub.com/googleapis/nodejs-storage#readmeDownloadsWeeklyDownloads1,574,686Version6.5.2LicenseApache-2.0UnpackedSize805kBTotalFiles40Lastpublish21daysagoCollaboratorsTryonRunKitReportmalware
延伸文章資訊
- 1@google-cloud/storage - npm
Cloud Storage allows world-wide storage and retrieval of any amount of data at any time. You can ...
- 2Cloud Storage 教學―使用方式、費用節省訣竅完整介紹
Cloud Storage 是Google Cloud 的儲存服務。在這篇文章裡面,您將會了解到Cloud Storage 的儲存空間級別介紹,及設定Cloud Storage的生命週期管理功能...
- 3Cloud Storage - Google Cloud Platform Console說明
Google Cloud Storage 能幫您把資料儲存到Google 的雲端系統。Cloud Storage 一般可用於儲存尚未結構化的資料,亦即物件或檔案;類型和大小皆不拘,容量可高達5 TB。
- 4Cloud Storage | Google Cloud
Cloud Storage 服務的計費方式為「以量計價」,包括儲存的資料量、儲存資料的時間長短、對資料執行的作業次數,以及在移動或存取資料時使用的網路資源。「冷儲存空間級別」 ...
- 5Cloud Storage簡介 - Google Cloud Platform In Practice - GitBook
Cloud Storage (GCS) 為Google新一代Object Storage,以Google Datacenter的規模,提供GCP的開發者使用。是為具備高性能、全球網際網路存取規模...