Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sync-cloud-storage

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-cloud-storage

[![NPM](https://img.shields.io/npm/v/sync-cloud-storage)](https://www.npmjs.com/package/sync-cloud-storage) [![Pipeline Status](https://github.com/msudgh/sync-cloud-storage/actions/workflows/ci.yml/badge.svg?branch=main)](./.github/workflows/ci.yml) [![Co

  • 1.0.0-rc.4
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
0
Weekly downloads
 
Created
Source

sync-cloud-storage

NPM Pipeline Status Codecov Status License

Synchronize files and directories between a remote machine and a cloud storage via cloud frameworks and stacks consisting of AWS SAM (Serverless) and AWS Cloud Development Kit (CDK). This package supports the following cloud storage providers: AWS S3.

Features

Installation

  • npm: npm i sync-cloud-storage
  • yarn: yarn add sync-cloud-storage
  • pnpm: pnpm add sync-cloud-storage
  • ni: ni sync-cloud-storage

Usage

AWS S3

Serverless

Sync storages action as a pre-deploy hook in the serverless.yml:

plugins:
  - sync-cloud-storage

custom:
  syncCloudStorage:
    - name: my-bucket
      patterns:
        - assets/*
      actions:
        - upload
        - delete
      prefix: assets
      acl: public-read
      metadata:
        foo: bar
        bar: foo
CDK

Call sync storages action after setting up a CDK App:

import { Stack, App } from '@aws-cdk/core'
import SyncCloudStorage from 'sync-cloud-storage'

const app = new App()
const stack = new Stack(app, 'MyStack')
const syncCloudStorage = new SyncCloudStorage(stack, {
  storages: [
    {
      name: 'my-bucket',
      patterns: ['assets/*'],
      actions: ['upload', 'delete'],
      prefix: 'assets',
      acl: 'public-read',
      metadata: {
        foo: 'bar',
        bar: 'foo',
      },
    },
  ],
})

// Sync storages
syncCloudStorage.storages()

// Sync tags
syncCloudStorage.tags()

// Sync metadata
syncCloudStorage.metadata()

Options

General

OptionNotesTypeRequiredDefault
storagesList of storages, Minimum items: 1array of storagetrueundefined
regionCloud (AWS) regionstringfalseundefined or AWS_REGION environment variable
endpointCloud (AWS) Endpoint URLstringfalseundefined or AWS_ENDPOINT_URL environment variable
offlineOffline modebooleanfalsefalse or IS_OFFLINE environment variable
disabledDisable syncbooleanfalsefalse
silentSilent output logsbooleanfalsefalse

Storage

OptionNotesTypeRequiredDefault
nameName of storage (AWS S3 Bucket), Minimum length: 1stringtrueundefined
patternsPatterns of glob paths to include or exclude on sync action, Minimum items: 1array of stringtrueundefined
actionsSync actions, Valid values: upload, deletearray of stringfalseupload, delete
prefixPrefix for the storage files and foldersstringfalse''
enabledEnable or disable the storage on sync actionbooleanfalsetrue
aclAWS S3 Canned ACL, Valid values: private, public-read, public-read-write, authenticated-readstringfalseundefined
metadataA set of metadata key/value pair to be set or unset on the objectobjectfalseundefined
tagsA set of tag key/value pair to be set or unset on the objectobjectfalse{}
gitignoreUse .gitignore file to exclude files and directoriesbooleanfalsefalse
ignoreFilesIgnore files and directories to exclude from sync actionarray of stringfalseundefined

Keywords

FAQs

Package last updated on 18 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc