Category: Nodejs

0

path.join vs path.resolve in node.js

path.join([…paths]) joins all the path segments using platform specific delimiter. path.join(‘/foo’, ‘bar’, ‘baz/zxcv’, ‘abcd’, ‘..’) // ‘/foo/bar/baz/zxcv/abcd/…’ path.resolve([…paths]) Resolves all the path segments into an absolute path. It processes from right to left, until...

0

path.join in nodejs

path.join() does two things : Joins all given path segments together using the platform specific separator as a delimiter Normalizes the resulting path path.join(‘src/’, ‘js/Router.jsx’); ‘src/js/Router.jsx’ on OSX and Linux ‘srcjsRouter.jsx’ on Windows Here,...

0

Update the publically published NPM package

Once you have made your changes in the local repository, npm version update_type where update_type is one of the semantic versioning release types, patch, minor, or major. npm publish Note: If this local repository...

npm list available versions of a package 1

npm list available versions of a package

As an example, to check which versions of expressjs are available on npm, you do the following npm info express versions Of course, you can always grep for the version you are looking for...

0

Error: listen EADDRINUSE

EADDRINUSE – stands for error: address already in use. It means you have a server listening on the same port. To solve this problem you have to kill the process running on that port....