https://github.com/connected-web/awsls2json
Converts AWS LS format to a JSON file
https://github.com/connected-web/awsls2json
Last synced: 4 months ago
JSON representation
Converts AWS LS format to a JSON file
- Host: GitHub
- URL: https://github.com/connected-web/awsls2json
- Owner: connected-web
- Created: 2016-09-28T07:23:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T09:04:12.000Z (almost 6 years ago)
- Last Synced: 2025-10-08T13:54:31.926Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# awsls2json
Converts the output of the aws cli command `aws s3 ls` to JSON format.
Reference:
-
## Usage
convert.js:
```javascript
const fs = require('fs');
const awsls2json = require('./awsls2json');
const filelist = fs.readFileSync('filelist.txt', 'utf8');
const json = awsls2json(filelist);
console.log('Result', json);
```
From the command line, or CI:
```sh
aws s3 ls s3://my-bucket-path/target-folder > filelist.txt
node convert.js
```
## Example Input
```sh
PRE eab12b4/
PRE ff3d347/
PRE unminified/
2016-11-09 16:13:02 8 latest-regression-candidate
```
## Example Output
```json
[{
"pre": "PRE",
"folder": "eab12b4"
},{
"pre": "PRE",
"folder": "ff3d347"
}, {
"pre": "PRE",
"folder": "unminified"
}, {
"date": "2016-11-09",
"time": "16:13:02",
"size": "8",
"file": "latest-regression-candidate"
}]
```
## Changelog
### Version 1.0.2
- Remove trailing slash from folder keys
### Version 1.0.1
- Add support for folders
### Version 1.0.0
- Initial release, with support for a files in a folder