Skip to content

Commit

Permalink
add: nodejs task 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhatech002 committed Feb 17, 2024
1 parent 8a35428 commit e2230be
Show file tree
Hide file tree
Showing 14 changed files with 168 additions and 0 deletions.
102 changes: 102 additions & 0 deletions NodeJs/01-File-System/data/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"id": 1,
"district": "Trichy",
"mustVisit": [
{
"name": "Sri Ranganathaswamy Temple",
"description": "One of the largest functioning Hindu temples in the world, dedicated to Lord Vishnu."
},
{
"name": "Rockfort Temple",
"description": "A historic fort complex with a temple perched on a rock, offering panoramic views of the city."
},
{
"name": "Srirangam Island",
"description": "An island formed by the rivers Kaveri and Kollidam, housing the Sri Ranganathaswamy Temple."
}
],
"famousFood": [
"Traditional Tamil cuisine including dosa, idli, sambar, and rasam."
],
"agricultureCrops": ["Rice", "Sugarcane", "Bananas", "Coconuts"],
"businessCulture": "Diverse economy with industries like manufacturing, education, and tourism contributing significantly. Known for educational institutions and engineering industry."
},
{
"id": 2,
"district": "Nagapattinam",
"mustVisit": [
{
"name": "Vedaranyam",
"description": "Known for the Vedaranyeswarar Temple dedicated to Lord Shiva and the nearby mangrove forests of Muthupet."
},
{
"name": "Kodiyakkarai",
"description": "A coastal town famous for its serene beaches and bird-watching opportunities, particularly during migratory bird seasons."
},
{
"name": "Velankanni",
"description": "Renowned for the Velankanni Church and beautiful beaches."
}
],
"famousFood": [
"Fresh seafood dishes like fish curry, prawn masala, and crab fry."
],
"agricultureCrops": ["Paddy", "Coconut", "Pulses", "Cashew nuts"],
"businessCulture": "Fishing, agriculture, tourism, salt production, and handicrafts contribute significantly to the economy."
},
{
"id": 3,
"district": "Coimbatore",

"mustVisit": [
{
"name": "Ooty",
"description": "Known for its tea plantations, botanical gardens, and scenic beauty."
},
{
"name": "Coonoor",
"description": "Famous for its picturesque landscapes, tea estates, and the Sim's Park botanical garden."
}
],
"famousFood": [
"Coimbatore is famous for its unique cuisine, including dishes like kozhikari, angannan biriyani, and idli with various chutneys."
],
"agricultureCrops": ["Tea", "Coffee", "Coconuts", "Bananas"],
"businessCulture": "Coimbatore is a major hub for textiles, manufacturing, and education. It's known for its entrepreneurial spirit and industrial development."
},
{
"id": 3,
"district": "Tirunelveli",
"mustVisit": [
{
"name": "Kanyakumari",
"description": "Renowned for its breathtaking sunrise, sunset views, and the Vivekananda Rock Memorial."
},
{
"name": "Courtallam",
"description": "Known as the 'Spa of South India' for its numerous waterfalls and natural beauty."
}
],
"famousFood": [
"Tirunelveli is famous for its unique cuisine, including dishes like Iruttu Kadai Halwa, Ulunthu Kali, and Karupatti Mittai."
],
"agricultureCrops": ["Paddy", "Coconuts", "Bananas", "Rubber"],
"businessCulture": "Tirunelveli is known for its agricultural products, especially paddy and coconuts. It also has a thriving handloom industry and is a major center for trade."
},
{
"id": 4,
"district": "Salem",
"mustVisit": [
{
"name": "Yercaud",
"description": "A hill station known for its pleasant climate, coffee plantations, and scenic viewpoints like Lady's Seat and Pagoda Point."
}
],
"famousFood": [
"Salem is famous for its unique cuisine, including dishes like Kal dosai, Mutton Chukka, and Biryani."
],
"agricultureCrops": ["Mangoes", "Poultry", "Sheep", "Cattle"],
"businessCulture": "Salem is known for its agricultural produce, particularly mangoes. It also has a significant presence in the poultry and livestock industries."
}
]
22 changes: 22 additions & 0 deletions NodeJs/01-File-System/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const fs = require("fs");

const likedDistricts = require("./data/data.json");

fs.mkdir("likedPlaces", () => {
console.log("folder created");
});

likedDistricts.map((place) => {
fs.mkdir(`./likedPlaces/${place.district}`, () => {
console.log(`${place.district} folder created`);
});
place.mustVisit.map((tovisit) => {
fs.writeFile(
`./likedPlaces/${place.district}/${tovisit.name}.md`,
`## ${place.district} \n ### ${tovisit.name} \n ${tovisit.description}`,
() => {
console.log(`${tovisit.name} file created`);
}
);
});
});
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Coimbatore/Coonoor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Coimbatore
### Coonoor
Famous for its picturesque landscapes, tea estates, and the Sim's Park botanical garden.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Coimbatore/Ooty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Coimbatore
### Ooty
Known for its tea plantations, botanical gardens, and scenic beauty.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Nagapattinam
### Kodiyakkarai
A coastal town famous for its serene beaches and bird-watching opportunities, particularly during migratory bird seasons.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Nagapattinam/Vedaranyam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Nagapattinam
### Vedaranyam
Known for the Vedaranyeswarar Temple dedicated to Lord Shiva and the nearby mangrove forests of Muthupet.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Nagapattinam/Velankanni.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Nagapattinam
### Velankanni
Renowned for the Velankanni Church and beautiful beaches.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Salem/Yercaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Salem
### Yercaud
A hill station known for its pleasant climate, coffee plantations, and scenic viewpoints like Lady's Seat and Pagoda Point.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Tirunelveli/Courtallam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Tirunelveli
### Courtallam
Known as the 'Spa of South India' for its numerous waterfalls and natural beauty.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Tirunelveli/Kanyakumari.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Tirunelveli
### Kanyakumari
Renowned for its breathtaking sunrise, sunset views, and the Vivekananda Rock Memorial.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Trichy/Rockfort Temple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Trichy
### Rockfort Temple
A historic fort complex with a temple perched on a rock, offering panoramic views of the city.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Trichy
### Sri Ranganathaswamy Temple
One of the largest functioning Hindu temples in the world, dedicated to Lord Vishnu.
3 changes: 3 additions & 0 deletions NodeJs/01-File-System/likedPlaces/Trichy/Srirangam Island.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Trichy
### Srirangam Island
An island formed by the rivers Kaveri and Kollidam, housing the Sri Ranganathaswamy Temple.
11 changes: 11 additions & 0 deletions NodeJs/01-File-System/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "01-file-system",
"version": "1.0.0",
"description": "create a folders and files using filesystem modules nodeJs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "vijayavedhasekaran",
"license": "ISC"
}

0 comments on commit e2230be

Please sign in to comment.