6

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?

azrael v
  • 281
  • 5
  • 17

1 Answers1

4

See child_process.exec

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