paint-brush
Mistakes I've made treating file paths as stringsby@philnash
209 reads

Mistakes I've made treating file paths as strings

by Phil Nash3mMarch 10th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Developer evangelist for Twilio and Authy. I love writing JavaScript and Ruby. I was trying to create a glob of paths with the line:. console.log('🍻)' When working with Node.js the `path` module is your friend. Use `path.join` whenever you have to join two paths. Concatenating two pathnames or a pathname and a string will add the separator (as someone pointed out in a comment on my commit) but concatenating two strings will not.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Mistakes I've made treating file paths as strings
Phil Nash HackerNoon profile picture
Phil Nash

Phil Nash

@philnash

Developer evangelist for Twilio and Authy. I love writing JavaScript and Ruby. console.log('🍻');

About @philnash
LEARN MORE ABOUT @PHILNASH'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Phil Nash HackerNoon profile picture
Phil Nash@philnash
Developer evangelist for Twilio and Authy. I love writing JavaScript and Ruby. console.log('🍻');

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here
Coffee-web