일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 푸시 데이터 저장
- 안드로이드 에러
- 노티피케이션 익스텐션
- swift sms
- 스위프트 푸시
- native flutter view
- 안드로이드 FCM
- FlutterView MethodChannel
- 스위프트 테이블 뷰 셀
- 스위프트
- 안드로이드 숏컷
- 스위프트 앨범
- swift 문자
- 플러터 뷰 컨트롤러
- 스위프트 카메라
- 스위프트 UserDefaults
- Swift flutterviewcontroller
- flutter 회전
- 안드로이드 앨범
- 앱 꺼졌을 때 푸시 데이터 저장
- swift autolayout
- 스위프트 웹뷰
- 안드로이드 바로가기
- silent push
- Flutter UIKitView MethodChannel
- Flutter NativeView
- Swift flutterview
- NotificationService Extension
- 앱 백그라운드 푸시 데이터 저장
- flutter rotate
- Today
- Total
Things take time
[NodeJS] 1일차 - 개념과 기본 모듈 사용법 본문
[개념]
노드는 서버 엔진, 서버 컴퓨터에 설치
javascript로 작성한 서버스크립트는 html로 확인할 수도 있지만, cmd에서 콘솔로도 확인할 수 있음 -> cmd에서 콘솔로 보여주는 프로그램이 node.exe(노드에 포함)이기에 해당 js파일 테스트할 때 'node 파일명' 을 사용하는 것
// 기본 콘솔 console.log('안녕 %d\n', 18); console.log("안녕 %j\n", {name:"겸"}); // time, timeEnd : 중간까지의 연산 과정에 걸린 시간을 return var result = 0; console.time("timer"); for(var i=1; i<=1000; i++){ result += i; } console.timeEnd("timer"); console.log("결과값은 %d \n", result); // __filename, __dirname : 상수 전역 변수, 로그기록할 때 자주 사용 console.log("현재 실행한 파일의 이름 : %s \n", __filename); console.log("현재 실행한 파일의 경로 : %s \n", __dirname); // console.dir() : ()안 객체의 상세 정보 var person = {name:"겸", age:30}; console.dir(person); console.log("process객체의 argv속성의 파라미터 수 : " + process.argv.length); console.dir(process.argv); // 배열.forEach(function(각 배열 객체, 순서)) process.argv.forEach(function(item, index){ console.log(index + " : " + item); })
[모듈]
별도의 js파일로 분리된 독립 기능, export라는 전역 객체를 사용해야 모듈안에 포함되게 됨
calc.js
var calc = {}; calc.add = function(a,b){ return a+b; }; module.exports = calc;
module.js : calc.js라는 모듈을 가져옴
// 모듈 호출 시, 경로를 입력하되 js는 뺌 var calc = require('./calc'); console.log("모듈 결과 값 : %d", calc.add(3,5));