varOSS=require('oss-js-client')// Instantiate the oss client with the endpoint// and access keys as shown below.varossClient=newOSS.Client({endPoint: '127.0.0.1',port: 9000,useSSL: false,accessKey: 'username',secretKey: 'password'});// File that needs to be uploaded.varfile='/tmp/file.txt'// Make a bucket called mybucket.ossClient.makeBucket('mybucket','us-east-1',function(err){if(err)returnconsole.log(err)console.log('Bucket created successfully in "us-east-1".')varmetaData={'Content-Type': 'application/octet-stream','X-Amz-Meta-Testing': 1234,'example': 5678}// Using fPutObject API upload your file to the bucket mybucket.ossClient.fPutObject('mybucket','file.txt',file,metaData,function(err,etag){if(err)returnconsole.log(err)console.log('File uploaded successfully.')});});