Aside from using the OSS Node.js SDK, you can directly use HTTP to download objects stored in OSS.

HTTP-based download supports browsers and command line interface (CLI) tools such as wget and curl. The object URL is generated through the SDK. Use signatureUrl to generate an HTTP-based address that can be used for downloads. The validity period of the URL is half an hour by default.

Use the following code to download an object from OSS over HTTP:

let OSS = require('ali-oss');

let client = new OSS({
  region: '<Your region>',
  accessKeyId: '<Your AccessKeyId>',
  accessKeySecret: '<Your AccessKeySecret>',
  bucket: 'Your bucket name'
});

let url = client.signatureUrl('object-name');
console.log(url);

let url = client.signatureUrl('object-name', {expires: 3600});
console.log(url);

// Generate the signed URL for PUT.
let url = client.signatureUrl('object-name', {method: 'PUT'});
console.log(url);