s3signer

Transform stream which reads S3 object keys and writes presigned S3 urls

s3signer

Transform stream which reads S3 object keys and writes presigned S3 urls.

The following opts must be passed in:

  • opts.key - AWS access key ID.
  • opts.secret - AWS secret access key.
  • opts.region - AWS geographic region.
  • opts.bucket - Existing S3 bucket for uploads.
  • opts.ttl - Miliseconds until signed urls expire

Return a transform stream which reads S3 object keys and writes presigned urls expiring when ttl in milliseconds passes.

var s3signer = require('s3signer')({
  key: process.env.AWS_ACCESS_KEY,
  secret: process.env.AWS_SECRET_KEY,
  region: process.env.AWS_REGION,
  bucket: process.env.S3_BUCKET
});
 
var signer = s3signer(60*1000);
 
signer.pipe(process.stdout);
 
signer.write('img/me.jpg');
signer.write('img/you.jpg');

MIT