Aylık arşivler: Kasım 2016

windows cmd bat file pass parameter sample

CopyFile.bat –>

@echo off
set param=%2
set argv1=%~dpnx1
set argv2=%~dpnx3
if %param% EQU -copy (
    if "%argv1%" NEQ "" if "%argv2%" NEQ "" (
        for %%a in ("%argv1%") do (
            if not exist "%argv2%" mkdir "%argv2%"
            copy /y %%a "%argv2%">Nul
    echo( Finish Copy [%argv1%] to [%argv2%]
    ) else echo( You need 3 argument!
) else echo( Wrong argument : %param%

And run it with command:

CopyFile.bat "nameoffile" -copy "C:\Example"

npm vs bower vs composer

npm is nodejs package manager. It therefore targets nodejs environments, which usually means server-side nodejs projects or command-line projects (bower itself is a npm package). If you are going to do anything with nodejs, then you are going to use npm.

bower is a package manager that aims at (front-end) web projects. You need npm and nodejs to install bower and to execute it, though bower packages are not meant specifically for nodejs, but rather for the “browser” environment.

composer is a dependency manager that targets php projects. If you are doing something with symfony (or plain old php), this is likely the way to go

Summing it up:

  • doing node? you do npm
  • doing php? try composer
  • front-end javascript? try bower

And yes, the “json” files describe basic package information and dependencies. And yes, they are needed.

Now, what about the READMEs? 🙂