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 148 views
148 views asked May 22, 2022 by avibootz
1 answer 123 views
1 answer 120 views
1 answer 119 views
2 answers 179 views
1 answer 210 views
...