Newton's Principia Mathematica
Miss any of our Open RFC calls?Watch the recordings here! »

aws-s3-push

1.1.0 • Public • Published

aws-s3-push

A module for aws s3 cdn push with cache

Installation

  npm i aws-s3-push --save-dev

Use it

  const awsS3Push = require('aws-s3-push');
  const rootPath = './dist'; // that means /dist/* all file and child dir file
 
 
  const push = new awsS3Push({
    bucketName,
    bucketDir,
    cachePath,
    region,
    accessKeyId, 
    secretAccessKey, 
    s3Params:{
      // CacheControl:'max-age=5184000'
    }
  });
 
  push.upload(rootPath); 
 
  // or use async/await to get the upload result
  const result = await push.upload(rootPath); // if success,result will be 1
  
 

Api

constructor params

method params

  • upload(path): sync upload to s3
    • path: the file dir you want push to s3 bucket.
  • clearCache(): clear cache file

Keywords

Install

npm i aws-s3-push

DownloadsWeekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

9.22 kB

Total Files

10

Last publish

Collaborators

  • avatar