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 153 views
153 views asked May 22, 2022 by avibootz
1 answer 126 views
1 answer 124 views
1 answer 127 views
2 answers 183 views
1 answer 218 views
...