@google-cloud/storage - npm

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

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



請為這篇文章評分?