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

No packages published