Skip to content

Aarthi1720/Node.js-file-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📂 TimeStamp File Creator API using Node.js & Express

This project is a simple backend API built using Node.js and Express.js that creates a new file with the current timestamp as the filename and content. It uses the built-in fs module for file system access and date-fns for date formatting 📆.


🛠 Tech Stack

  • Node.js
  • Express.js
  • fs (file system Module)
  • date-fns
  • dotenv
  • CORS

📄 Example

If you hit /file at 17th June 2025, 10:30:45, a file will be created like:

TimeStamps/17-06-2025-10-30-45

And the content will be:

17-06-2025-10-30-45

📘 What I Practiced

  • Using Express.js to set up routes
  • Reading and writing file using fs
  • Formating timestamps using date-fns
  • Creating REST APIs
  • Using dotenv for environment configuration

📌 Notes

  • Ensure the TimeStamps folder exists before starting the server.
  • Make sure the port in .env is not already used by another process.

About

A simple Node.js + Express API that creates timestamped files using date-fns and fs module.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors