How to convert JSON to string or string to JSON

    To convert string to JSON use
      var jsonObject = JSON.parse(string);
    To convert JSON to string use:
    var dataString = JSON.stringify(jsonObject);

    How to install nvm nodejs on mac os

    To installnvm nodejs on mac first install curl if you don't have then run below commands: To check and install versions of nodejs
    nvm ls-remote

    nvm install v0.12.5
    nvm alias default 0.12.5
    nvm use 0.12.5

    How to install nvm on mac

    To install nvm on mac follow these steps
    git clone git:// ~/.nvm

    printf "\n\n# NVM\nif [ -s ~/.nvm/ ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/\nfi" >> ~/.bashrc


    source ~/.nvm/

    Completely uninstall nodejs on mac

    Follow these steps:

    go to /usr/local/lib and delete any node and node_modules
    go to /usr/local/include and delete any node and node_modules directory
    if you installed with brew install node, then run brew uninstall node in your terminal
    check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
    go to /usr/local/bin and delete any node executable

    You may need to do the additional instructions as well:

    sudo rm /usr/local/bin/npm
    sudo rm /usr/local/share/man/man1/node.1