Map file extensions to MIME types and back using the same database Node uses (mime-types).
image/png
.png
Some MIME types map to multiple extensions; this tool returns the canonical one from the library.