Timed File - versioning with files
npm install timedfile



If you need a single file to be versioned, this wrapper for you.
You can save, rollback, fastforward, reset and clean
* save to create a version on the timeline which you rollback, fastforward or reset to.
* rollback to go back to a version which you have saved before
* fastforward to fast forward to a version during a rollback
* reset to remove all existing changes to the current version on the timeline (not always the latest)
* clean to remove all existing versioning data (including commits and rollbacks), as good a new timedfile.
* diff shows the content difference between modified text and current saved state
* diffs shows a timeline of all the changes in diff format from npm-diff
Examples of how to use the wrapper - Using Async/Await
For more usage examples, you can refer to the full documentation unit tests
#### To Save
``js`
const timedFile = new TimedFile({fileFullPath: 'PathToFile'});`
Here is where you write something to the file js`
fs.appendFileSync(pathToFile, 'Some New Line');
* Saving
`js`
await timedFile.save(author);
#### To Rollback
`js`
const timedFile = new TimedFile({fileFullPath: 'PathToFile'});
Here is where you write and save to the file a few times.
`js`
fs.appendFileSync(pathToFile, 'Some Line');
await timedFile.save(author);
fs.appendFileSync(pathToFile, 'Some Line Again');
await timedFile.save(author);
* Rollback
`js`
await timedFile.rollback();Some Line Again
It rollbacks to a version without the last entry of
#### To FastForward
Continuing from the Rollback scenario
* Fastforward
`js`
await timedFile.fastforward();Some Line Again
It rollbacks to a version with the last entry of
#### To Reset
Regardless of the contents in the file,
* Reset
`js`
await timedFile.reset();
* Clean
`js`
await timedFile.clean();
#### To Diff
* Diff
`js`
await timedFile.diff();
* Diffs
`js``
await timedFile.diffs();