Symlink a package folder. Consider the example where you have test package inside node modules and you want to change in that package. You could make changes in node_modules and manually copy the changes to the git repository of the dependency once you are done. But there is a much cleaner approach: npm link. Package… Continue reading Understanding npm link
Author: Swapna
Disable right click on web page
One has to use JavaScript to accomplish this. If the user has JS disabled, you cannot prevent the right click. You can do it either by adding an event listener to for the “contextmenu” event and calling the preventDefault() method. Eg: or just by adding “oncontextmenu” to body tag.
CSS Less @keyframes animation error
How to solve when you get Less @keyframe animation error. Follow the following steps: Check less version and upgrade it if it is not latest globally by sudo npm install less@3.9.0 -g Check less version by lessc -v If above command gives an error “/usr/bin/env: ‘node’: No such file or directory” then run below command… Continue reading CSS Less @keyframes animation error
Environment Variables in Angular
Need to use different values depending on the environment you’re in? If you’re building an app that talks to the Stripe API for example, you’ll want to use your test publishable key during development and then your live publishable key in production. It’s easy to do in Angular using the environment.ts file. Angular CLI projects already use… Continue reading Environment Variables in Angular
What is the difference between npm and bower?
npm is most commonly used for managing Node.js modules, but it works for the front-end too. Bower is created solely for the front-end and is optimized with that in mind. The biggest difference is that npm does nested dependency tree (size heavy) while Bower requires a flat dependency tree (puts the burden of dependency resolution on… Continue reading What is the difference between npm and bower?