How to concatenate (join) paths in Node.js

1 Answer

0 votes
const path = require('path');

const folder = 'orders';
const filename = 'index.html';
console.log(path.join(__dirname, folder, filename));


     
/*
run:
   
c:\JavaScript\orders\index.html
 
*/

 



answered Mar 9, 2020 by avibootz

Related questions

2 answers 263 views
263 views asked May 22, 2022 by avibootz
1 answer 231 views
1 answer 211 views
1 answer 200 views
2 answers 299 views
1 answer 294 views
...