@google-cloud/storage - npm

文章推薦指數: 80 %
投票人數:10人

@google-cloud/storage. TypeScript icon, indicating that this package has built-in type declarations. 5.16.0 • Public • Published 21 days ago. @google-cloud/storage5.16.0 • Public • Published22daysagoReadmeExploreBETA19Dependencies1,291Dependents114Versions 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 CreateBucketWithStorageClassandLocation. sourcecode CreateNewBucket sourcecode CreateNotification sourcecode DeleteBucket sourcecode DeleteFile sourcecode DeleteNotification sourcecode DeleteOldVersionOfFile. sourcecode DisableBucketLifecycleManagement sourcecode StorageDisableBucketVersioning. sourcecode DisableDefaultEventBasedHold sourcecode DisableRequesterPays sourcecode DisableUniformBucketLevelAccess sourcecode DownloadEncryptedFile sourcecode DownloadFile sourcecode DownloadFileUsingRequesterPays 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 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 SetEventBasedHold sourcecode SetPublicAccessPreventionEnforced sourcecode SetPublicAccessPreventionInherited sourcecode SetPublicAccessPreventionUnspecified sourcecode SetRetentionPolicy sourcecode SetTemporaryHold sourcecode StreamFileDownload sourcecode StreamFileUpload sourcecode Uploadadirectorytoabucket. sourcecode UploadEncryptedFile sourcecode UploadFile sourcecode UploadFileWithKmsKey sourcecode ViewBucketIamMembers sourcecode TheGoogleCloudStorageNode.jsClientAPIReferencedocumentation alsocontainssamples. SupportedNode.jsVersions OurclientlibrariesfollowtheNode.jsreleaseschedule. Librariesarecompatiblewithallcurrentactiveandmaintenanceversionsof Node.js. Clientlibrariestargetingsomeend-of-lifeversionsofNode.jsareavailable,and canbeinstalledvianpmdist-tags. Thedist-tagsfollowthenamingconventionlegacy-(version). LegacyNode.jsversionsaresupportedasabesteffort: Legacyversionswillnotbetestedincontinuousintegration. Somesecuritypatchesmaynotbeabletobebackported. Dependencieswillnotbekeptup-to-date,andfeatureswillnotbebackported. Legacytagsavailable legacy-8:installclientlibrariesfromthisdist-tagforversions compatiblewithNode.js8. Versioning ThislibraryfollowsSemanticVersioning. ThislibraryisconsideredtobeGeneralAvailability(GA).Thismeansit isstable;thecodesurfacewillnotchangeinbackwards-incompatibleways unlessabsolutelynecessary(e.g.becauseofcriticalsecurityissues)orwith anextensivedeprecationperiod.IssuesandrequestsagainstGAlibraries 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,505,230Version5.16.0LicenseApache-2.0UnpackedSize621kBTotalFiles26Lastpublish22daysagoCollaboratorsTryonRunKitReportmalware



請為這篇文章評分?