https://github.com/yetanalytics/datechanger
Updates statement timestamps to begin at specified date
https://github.com/yetanalytics/datechanger
Last synced: 6 months ago
JSON representation
Updates statement timestamps to begin at specified date
- Host: GitHub
- URL: https://github.com/yetanalytics/datechanger
- Owner: yetanalytics
- License: apache-2.0
- Created: 2022-04-12T21:25:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-19T12:58:30.000Z (about 4 years ago)
- Last Synced: 2024-12-27T23:13:27.976Z (over 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xAPI Statement Date Changer
Simple CLI script that updates xAPI Statement timestamps to start at provided date.
There are 3 CLI arguments
1. `date` (Required) - desired timestamp value for most recent xAPI Statement
* e.g. `"2022-04-12T12:00:00Z"`
2. `sourceFile` (Required) - path to JSON file which contains xAPI Statements to update
* e.g. `./data/example_data.json`
3. `targetFile` (Optional) - path to JSON file to store updated xAPI Statements in
* e.g. `./data/example_output_data.json`
An error is thrown when
* `date` and/or `sourceFile` are not provided.
* an xAPI Statement within the `sourceFile` does not contain `$.timestamp`
## Usage
`node datechanger.js "2022-04-12T12:00:00Z" ./data/example_data.json`
- logs updated xAPI Statements to out
`node datechanger.js "2022-04-12T12:00:00Z" ./data/example_data.json ./data/example_output_data.json`
- writes updated xAPI Statements to "example_output_data" JSON file within the data directory