How to publish a package on npm
So, you are ready to publish a package to npm but are not sure how to go about it? This blog post aims to provide one approach to publishing packages onto npm. So, read...
@tutorialhorizon
So, you are ready to publish a package to npm but are not sure how to go about it? This blog post aims to provide one approach to publishing packages onto npm. So, read...
Let’s say we have ./darwin.js for mac, ./win32.js for Windows in the current working directory. And we want to require one of them in ./index.js based on which platform the file is being ran....
System Under Test Let’s say we have a method call sequence to run promise based commands in sequence. For example, below command runs c1 and when it resolves it will run c2 and so...
If you are using nvm for managing nodejs(which is the recommended way), you can easily ensure that the same version of nodejs is available in all terminal windows or tabs. Below are some helpful...
This is very common error when your project has ES6 modules as well as require.js module systems. Here, I will show you few examples on how to require ES6 modules inside an AMD module....
Install the following packages : npm i –save babel-register npm i –save babel-preset-latest Create an entry point. For example, index.js It transpiles your app at runtime by hooking into all require calls, and lets...
node-uuid provide a simpler and reliable way to create unique id. It is rigorous implementation of RFC4122 (v1 and v4) UUIDs. // npm i node-uuid var uuid = require(‘node-uuid’); // Generate a v1 (time-based)...
If you have an active nodejs process running on your system, the easiest way to check what environment variables it is using can be done in 2 simple steps. Identify the process id of...
I bumped into this issue when trying to run my node application using pm2. From my understanding, a combination of the following factors causes the issue pm2 usually needs to be installed globally, which...
Recently when I was trying to run my application on an ubuntu virtual server, I kept getting the error npm command not found even though I had installed nvm an node. Based on my...