Tag Archives: nodejs

OSX Global NPM Module command not found

In case you ended up in a situation where you just installed a global NPM module, but it still throws command not found, here’s what you have to do: Find out where the global NPM modules are installed by running: Double check that your $PATH does not already contain that value: If the value is Continue Reading »

Node n permission denied without sudo

Each time I do a fresh install of the Node Version Management tj/n I end up getting the permission denied when running npm install. If you also ran into this issue, well, there’s a quick fix. The issue is caused by the Node Version Management for which the owner is the root. The two following Continue Reading »

NPM module command not found

Until you properly config your environment you’ll probably run into the command not found error when trying to run globally installed NPM modules. Solution for Linux and OSX: Step 1 – check if the path is correct You need to have /users/<ME>/.npm-global/bin in your $PATH If the printed string doesn’t contain the above path, continue Continue Reading »

Socket.IO AngularJS Wrapper

I’ve been playing around with Socket.IO and AngularJS. To make things easier I created this service which can be used for transferring data between the client (which could be a web page) and a NodeJS server. The app is served by NodeJS so the Socket.IO server is listening on same location. ‘use strict’; angular .module(‘APP’) Continue Reading »

NodeJS AES256 Encryption/Decryption

In one of my projects I needed to encrypt some data. I decided to use AES256 symmetrical encryption algorithm. So this is what I’ve come to (aes_encryption.js): var crypto = require(‘crypto’), cipher_seed = ‘some_random_characters’; var encrypt = function(text) { var cipher = crypto.createCipher(‘aes-256-cbc’, cipher_seed), crypted = cipher.update(text, ‘utf8’, ‘hex’); crypted += cipher.final(‘hex’); return crypted; }; Continue Reading »

Finalize – JavaScript Asynchronous Requests Queue

Most web apps send lots of asynchronous http requests. Sometimes you need to know when some selected requests are finished so that you can pass to the next step. The following function can be used for creating a queue with asynchronous requests using JavaScript and be notified when the queue is empty again (all selected Continue Reading »