https://nodejs.org/dist/latest-v20.x/docs/api/path.html
// path 모듈 연습하기 ( 결과 비교 파일 : 03\results\path.js)
const path = require("path");
//join - 파라미터를 묶어서 하나의 path로 만듬 -> some/work/ex.txt
const fullPath = path.join("some", "work", "ex.txt");
console.log(fullPath);
// dirname 파일이름을 제거한 경로만 추출 -> some/work
const dir = path.dirname(fullPath);
console.log(dir);
// basename 파일이름을 제거한 경로만 추출 -> path.js
//__filename는 글로벌모듈에 있는것 - 현재 파일의 전체 경로를 담고 있음 -> 전체경로 : /Users/jini.choi/Documents/jini/doit-node/basics/03/path.js
const base = path.basename(__filename);
console.log(`전체경로 : ${__filename}`);
console.log(base);
// 지정한 확장자 빼고 추출
const base2 = path.basename(__filename, ".js");
console.log(base2);