# Change Log

All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).

# v4.2.13
## (2026-06-11)

* Update dependency chai to v5 [balena-renovate[bot]]

# v4.2.12
## (2026-06-11)

* Update docker Docker tag to v25 [balena-renovate[bot]]

# v4.2.11
## (2026-04-14)

* Use Size - SharedSize for reclaim accounting [Kyle Harding]

# v4.2.10
## (2026-04-10)

* Update docker Docker tag to v24.0.9 [balena-renovate[bot]]

# v4.2.9
## (2026-04-10)

* Treat 409 conflict errors as noop during image removal [Kyle Harding]

# v4.2.8
## (2026-04-10)

* Update dependency typescript to v6 [balena-renovate[bot]]

# v4.2.7
## (2026-04-10)

* Add info about the size and mtime of images being removed [Pagan Gazzard]

# v4.2.6
## (2026-04-07)

* Switch mtime tracking from timeNano to time (seconds) [Kyle Harding]
* Fix cascading deletion ordering in getImagesToRemove [Kyle Harding]
* Fix getMtime resolution across ID and tag keys [Kyle Harding]

# v4.2.5
## (2026-04-02)

* Fix tests for containerized cross-platform execution [Kyle Harding]

# v4.2.4
## (2026-04-02)

* Persist mtimes across stream restarts [joshbwlng]

# v4.2.3
## (2026-04-01)

* Use a `Map` for storing the layer mtimes [Pagan Gazzard]

# v4.2.2
## (2026-03-21)

* Treat already removed images as a noop [joshbwlng]

# v4.2.1
## (2026-02-23)

* Add id-token: write permission for NPM OIDC publishing [Kyle Harding]

# v4.2.0
## (2025-12-13)

* Add public method to destroy mtime stream [joshbwlng]

# v4.1.7
## (2025-10-13)

* Switch from `es.pipeline` to native `pipeline` [Pagan Gazzard]
* Switch from `es.mapSync` to native `Transform` stream [Pagan Gazzard]

# v4.1.6
## (2025-10-10)

* Update dependencies [Pagan Gazzard]

# v4.1.5
## (2025-04-02)

* Update dependency mocha to v11 [balena-renovate[bot]]

# v4.1.4
## (2025-03-25)

* Update @balena/lint to 9.x [Pagan Gazzard]

# v4.1.3
## (2024-07-23)

* Update dependencies and fix lint warnings [Pagan Gazzard]

# v4.1.2
## (2024-07-23)

* Retry reconnecting the mtime stream with an exponential backoff [Pagan Gazzard]

# v4.1.1
## (2024-07-09)

* Listen for errors on the mtime stream and set it back up as necessary [Pagan Gazzard]

# v4.1.0
## (2024-03-08)

* Use partial updates for rebuilding the removal candidate list [Pagan Gazzard]

# v4.0.4
## (2024-03-07)

* Update dependencies [Pagan Gazzard]

# v4.0.3
## (2023-12-08)

* Remove unnecessary await [Pagan Gazzard]

# v4.0.2
## (2023-12-07)

* Remove dependency on bluebird [Pagan Gazzard]
* Remove dependency on lodash [Pagan Gazzard]
* Remove unnecessary check before deleting layer mtime info [Pagan Gazzard]
* Make it clear that `getImagesToRemove` mutates the passed in tree [Pagan Gazzard]

# v4.0.1
## (2023-12-05)

* Use native promises with dockerode [Pagan Gazzard]
* Convert to async/await [Pagan Gazzard]

# v4.0.0
## (2023-12-04)

* Update to dockerode 3.x [Pagan Gazzard]
* Convert to typescript [Pagan Gazzard]

# v3.5.12
## (2023-12-04)

* Update event-stream to 4.x [Pagan Gazzard]

# v3.5.11
## (2023-12-04)

* Remove unused `@balena/node-metrics-gatherer` dependency [Pagan Gazzard]

# v3.5.10
## (2023-11-30)

* Optimize `getMtimeFrom` [Pagan Gazzard]

# v3.5.9
## (2023-11-29)

* Fix exported typings [Pagan Gazzard]

# v3.5.8
## (2023-11-29)

* Update to eventemitter3 v5 [Pagan Gazzard]

# v3.5.7
## (2023-11-28)

* Import bluebird as `Bluebird` instead of `Promise` [Pagan Gazzard]

# v3.5.6
## (2023-11-28)

* Remove unused `mz` dependency [Pagan Gazzard]

# v3.5.5
## (2023-10-16)

* add support for arm32 architecture [Anton Belodedenko]

# v3.5.4
## (2023-08-01)

* Run tests using dind to avoid interactions with existing images [Pagan Gazzard]
* Only default the mtime to "now" for unrecognized images rather than old [Pagan Gazzard]

# v3.5.3
## (2023-03-27)

* Add typings [Pagan Gazzard]

# v3.5.2
## (2023-03-27)

* Replace balenaCI with flowzone [Pagan Gazzard]

# v3.5.1
## (2021-05-06)

* Update dependencies (docker-progress) [Paulo Castro]
* Add .resinci.yml (don't run tests that will fail anyway) [Paulo Castro]
* Added package-lock=false to .npmrc (libs should not use package-lock) [Paulo Castro]

# v3.5.0
## (2020-07-01)

* Improve image removal logging [Tomás Tormo]

# v3.4.0
## (2020-06-25)

* Don't consider images in use [Tomás Tormo]

# v3.3.2
## (2020-05-15)

* Emit image removal metrics [Tomás Tormo]
* Emit removal metrics [Tomás Tormo]

# v3.3.1
## (2020-05-14)

* Emit image removal metrics [Tomás Tormo]

# v3.3.0
## (2020-05-12)

* Add image removal metrics [Tomás Tormo]

# v3.2.0
## (2020-05-01)

* Enable removing images by digest [Tomás Tormo]

# v3.1.1
## (2020-03-20)

* Fix checking if an image has repoTags [Pagan Gazzard]

# v3.1.0
## (2020-03-20)

* Add option to attempt all garbage collection before throwing an error [Pagan Gazzard]

# v3.0.1
## (2020-03-20)

* Fix setting default mtimes for existing images at startup [Pagan Gazzard]

## 3.0.0 - 2020-03-17

* Default existing images to an mtime of 0 when setting up mtime stream [Pagan Gazzard]

## 2.3.1 - 2020-03-17

* Add linting [Pagan Gazzard]

## 2.3.0 - 2020-03-17

* Publish compiled javascript rather than relying on runtime compilation [Pagan Gazzard]

## 2.2.0 - 2019-10-01

* Update docker-progress [Pagan Gazzard]

## v2.1.1 - 2018-04-18

* Add follow: true to container.logs call #22 [Alexis Svinartchouk]

## v2.1.0 - 2018-02-23

* Remove images by their repoTags if they have some. #20 [Alexis Svinartchouk]

## v2.0.0 - 2018-02-23

* Use nanoseconds #18 [Alexis Svinartchouk]
* Change garbageCollect logic #18 [Alexis Svinartchouk]
* Remove the container we create to run `df` #18 [Alexis Svinartchouk]
* Match images with events by image ids and tags #18 [Alexis Svinartchouk]
* Factorize GC tests, pull images sequentially #18 [Alexis Svinartchouk]
* Update lodash #18 [Alexis Svinartchouk]

## v1.2.0 - 2017-11-03

* Probe for remote host architecture and use specific base image #16 [Cameron Diver]

## v1.1.3 - 2017-11-03

* Don't version alpine image to ensure arch-specific image can be pulled #14 [Cameron Diver]
* Use docker-progress to pull requisite images #14 [Cameron Diver]

## v1.1.2 - 2017-10-31

* Use Bluebird as Promise for created Dockerode objects. #12 [Alexis Svinartchouk]

## v1.1.1 - 2017-10-26

* Report size in bytes, and fix total space reporting #10 [Cameron Diver]

## v1.1.0 - 2017-10-26

* Add a disk usage method which will work on remote hosts #9 [Cameron Diver]

## v1.0.0 - 2017-10-26

* Export garbage collection as a class to allow multiple instances #8 [Cameron Diver]

## v0.1.0 - 2017-07-26

* Switch to v2 of circleCI [Cameron Diver]
* Use dockerode's inbuilt promise interface [Cameron Diver]
* Add garbageCollect tests [Cameron Diver]
* Fix bug where undefined error would occur if no images were present [Cameron Diver]
* Report when image failed to be removed [Cameron Diver]
* Expose garbageCollect function to callers [Cameron Diver]

## v0.0.2 - 2017-07-13

* Minor bugfixes for initial release [Cameron Diver]

## v0.0.1 - 2017-07-17

* Implement garbageCollect function
