Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Check the module resolution in the docs.
You can omit several things and it'll lookup automatically -
@alexbrooklyn I have seen that I believe but that is not cross-platform so I wouldn't do it, personally.
@Krokoklemme A folder named "serve" :/ -
pain3245y@alexbrooklyn @AlgoRythm
Should work on pretty much every system as long as node is in the path
@highlight
#!/usr/bin/env node -
@BugsBuggy They don't in determining the type of the file on linux (they do on Windows, though).
But without the extension, I would expect it to throw a file not found error, since the file "server.js" exists, but "server" does not.
ONLY TODAY did I learn that the ".js" is optional in node when running a script.
I always ran "node server.js"
But by accident I ran "node server .js" with a space and it worked, I wondered why, and then ran
"node server" and it just fucking works. That's awesome.
rant