📁Language/🟢 Node.js

    [Node.js] npm

    npm : node package manager https://www.npmjs.com/ npm Bring the best of open source to you, your team, and your company Relied upon by more than 17 million developers worldwide, npm is committed to making JavaScript development elegant, productive, and safe. The free npm Registry has become the center of Java www.npmjs.com 패키지 설치 # 현재 프로젝트내에 설치 npm install {패키지 이름} # 전역(global)에 설치 npm install ..

    [Node.js] Mac 개발환경 구축

    설치 brew update brew install node node -v //node 버전 확인 npm -v //npm 버전 확인 node.js 공식 문서 https://nodejs.org/dist/latest-v19.x/docs/api/ Index | Node.js v19.5.0 Documentation nodejs.org

    [Node.js] package.json 생성

    ENOENT: no such file or directory, open package.json pacakage.json 파일이 없을때 npm init - 특별히 설정할 것이 없다면 전부 enter를 눌러 넘어간다. npm install

    [Node.js] PM2

    [Node.js] PM2

    설치 https://pm2.keymetrics.io/ PM2 - Home Advanced process manager for production Node.js applications. Load balancer, logs facility, startup script, micro service management, at a glance. pm2.keymetrics.io Package Manager - 소프트웨어를 관리, 업데이트, 설정해주는 것 - Nodejs 에서는 NPM을 사용함 PM2 - nodejs가 실행되다 꺼지면 다시 켜줌 - 파일을 수정한 경우 nodejs를 껏다키지 않아도 수정사항 바로 반영 (자동으로 껏다켜줌) 설치 npm install pm2 -g 명령어 실행 pm2 start {파일이름}..

    [Node.js] 콜백 callback

    callback.js var a = function(){ //'a'라는 변수의 정의 console.log('A'); } function testfunc(callback){ //2.testfunc함수는 callback이라는 파라미터를 갖는다. callback(); //3.callback 함수를 실행해라 } testfunc(a); //1.testfunc함수를 변수a를 넣어서 실행해라 실행 명령어 node callback.js 출력 : A

    [Node.js] Window 개발환경 구축

    [Node.js] Window 개발환경 구축

    다운로드 https://nodejs.org/ko/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org - LTS 다운 설치 확인 - cmd창 (Window + r) 종료 : ctrl + c 두번 파일 실행하기 - 폴더 하나 만든다. - 폴더 내에 .js 파일 하나 만든다. - cmd창으로 실행해본다 생성한 파일 경로로 이동 cd {파일을 생성한 디렉터리 경로} 디렉터리내 파일 보기 dir 실행 node {파일이름}