Here's an example code snippet in TypeScript using Node.js' fs
(filesystem) module to get the last modified date of a JSON file:
index.ts272 chars14 lines
In this code snippet, we're importing Node.js' built-in fs
module and defining a filename
variable containing the name of our JSON file. We then use the fs.stat()
function to get the file stats, including the mtime
(last modified time) property. Finally, we log the last modified date to the console.
gistlibby LogSnag