atma-io-transport-s3
v0.9.19
Published
AWS S3 Transport for Atma-Io
Downloads
2
Readme
AWS S3 and AWS S3 compatible transport for atma-io
.
The plugin adds s3://
protocol support to atma-io
library.
's3://BUCKET/PATH'
Only
ASYNC
api is supported
await io.File.writeAsync('s3://mybucket/foo/bar.txt', 'Lorem ipsum');
let content = await io.File.readAsync('s3://mybucket/foo/bar.txt');
await io.File.copyTo('./localfile.txt', 's3://mybucket/remotefile.txt');
See the atma-io
API for File
and Directory
. Sync
methods are not supported, and exceptions will be thrown.
Get started
- When
atma
toolkit,atma
server,app-bundler
are used, you just have to enable and configurate the plugin inpackage.json
:
{
// package.json options
"atma": {
"plugins": [
"atma-io-transport-s3"
],
"options": {
"atma-io-transport-s3": {
// OPTIONALY HERE the settings but better via ENV
"accessKeyId": "",
"secretAccessKey": "",
"region": "",
"endpoint": "",
"sslEnabled": "",
}
}
}
}
ENV:
process.env.AWS_KEY;
process.env.AWS_SECRET;
process.env.AWS_REGION;
process.env.AWS_ENDPOINT;
'AWS_SSL' in process.env;
No further configuration or registration is required. Just use the s3
protocol.
- Configurate and register manually
import { File } from 'atma-io'
import Transport from 'atma-io-transport-s3'
Transport.init(File, { /* aws options or ENV will be read */ });
After that you can use s3
protocol in the application.
(c) MIT - Atma.js Project