Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@koopjs/filesystem-s3
Advanced tools
Koop integration with Amazon S3
koop-s3fs should be installed as a dependency in a Node.js project like so:
npm install koop-s3fs --save
koop-s3fs requires a json config file like so:
{
"filesystem": {
"s3": {
"bucket": $S3_BUCKET,
"endpoint" $S3-ENDPOINT //optional https://forums.aws.amazon.com/ann.jspa?annID=3112
}
}
}
Additionally you will need to supply your:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
or configure the AWS CLI with keys.
const Filesystem = require('koop-s3fs')
const s3fs = new Filesystem()
const fs = require('fs')
/**
* createWriteStream writes to AWS S3 as a Highland stream
*
* @param {string} name - filename
* @param {object} options - optional metadata to attach to file
* @returns {stream} stream
*/
const stream = fs.createReadStream('path/to/file')
.pipe(s3fs.createWriteStream('filename'))
/**
* createReadStream reads file from AWS s3 as highland stream
*
* @param {string} file - filename
* @returns {stream}
*/
s3fs.createReadStream('filename').toArray(arr => {
const txt = arr.toString()
console.log(txt)
})
/**
* stat accesses file metadata
*
* @param {string} file - filename
* @param {function} callback
* @returns {promise} returns resolved promise
*/
s3fs.stat('filename', (err, data) => {
console.log(data)
/* Stats {
getEntry: [Function],
dev: 0,
mode: 0,
nlink: 0,
uid: 0,
gid: 0,
rdev: 0,
blksize: undefined,
ino: 0,
size: 37,
blocks: undefined,
atime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),
mtime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),
ctime: Wed Apr 13 2016 13:15:14 GMT-0400 (EDT),
birthtime: Invalid Date,
acceptRanges: 'bytes',
ETag: '"b3b285a1749957f3e3a627a8e92b65bc"',
ContentType: 'application/octet-stream',
Metadata: { test: 'this is a test' } }
*/
})
FAQs
An AWS S3-backed filesystem plugin for Koop
The npm package @koopjs/filesystem-s3 receives a total of 4 weekly downloads. As such, @koopjs/filesystem-s3 popularity was classified as not popular.
We found that @koopjs/filesystem-s3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.