How do I programmatically use the S3FS module? I've included S3FS module in Drupal 7. I'm able to store files by using S3FS as a field of a node. 

Now, I need to store a file on S3 bucket when a cron job is executed. How can I programmatically use the module?
I used the following command to write the file. The system picks up the S3 connection (as I mentioned earlier that I'm able to store file as a field of a node):

file_put_contents('s3://Dir1/output.json', $jsonStr);