3

I need to write a terminal command like the following within my NodeJS application to copy a S3 file:

aws s3 cp s3://path-to-s3-fle local-file

Is there a way to do that from within the Node/JavaScript code? Any modules/dependencies that let you easily achieve that?

Ashish Verma
  • 251
  • 4
  • 17

1 Answers1

3

See child_process.exec

const {exec} = require('child_process');
exec('aws s3 cp s3://path-to-s3-fle local-file');
gabriel.hayes
  • 2,210
  • 10
  • 15