TIL (Today I Learned)
-
#TIL_J^&^U&^@&^G^&*%$%R%^^%U^#%^I&^K% 정규식에 대해 알아보자!.!TIL (Today I Learned) 2023. 11. 24. 15:27
# 정규식이란? 정규식(Regular Expression)은 특정한 규칙을 가진 문자열을 표현하고 검색, 매칭, 치환하는데 사용되는 형식 언어입니다. 이는 문자열 패턴을 기술하기 위한 강력한 도구로, 다양한 프로그래밍 언어와 텍스트 편집기에서 지원됩니다. 정규식을 이해하는 것은 텍스트를 활용하여 부가 가치를 창출하는데 필수적입니다. 우리는 일상생활에서 방대한 양의 텍스트를 생산하며, 이를 자연어 처리를 통해 인공지능으로 활용하거나 웹 크롤링을 통해 웹 페이지의 정보를 추출하는 등 다양한 방식으로 활용합니다. 정규식은 이러한 작업을 효율적으로 수행하는데 도움을 주며, 특정한 패턴을 갖는 문자열을 검색하거나 조작하는데 유용합니다. # 정규식의 사용이유 *** 문자열 검색과 매칭 특정한 패턴을 가진 문자열을 ..
-
#TIL_옵셔널 체이닝(Optional Chaining)이 있어서 듬직허다TIL (Today I Learned) 2023. 11. 23. 00:22
# 옵셔널 체이닝(Optional Chaining)이란? 옵셔널 체이닝은 존재하지 않을 수 있는 프로퍼티 또는 메서드를 안전하게 호출할 수 있도록 도와줍니다. 프로그래밍에서 null 또는 undefind 등의 값으로 인해 발생할 수 있는 오류를 방지하고 처리하기 위한 기술입니다. 객체 또는 배열의 속성에 연속적으로 접근할 때, 해당 속성이 존재하지 않아 발생하는 오류를 방지합니다. 일련의 속성 접근 중, 하나라도 null 또는 undefined인 경우에도 오류를 발생시키지 않고 그대로 실행을 진행하며, 마지막으로 접근한 속성의 값이 존재하지 않으면 undefined를 반환합니다. # 실제 적용한 코드 사례 // 프로젝트 일부_auth.router.js 파일 import { Router } from 'ex..
-
#TIL_CommonJS문법과 ES6문법을 이어주는 마법 도구가 있다??? Babel에 대해 알아보자!.!(핵심 마지막 Node.js 서버 실행 부분)TIL (Today I Learned) 2023. 11. 21. 23:11
# Babel이란? Babel은 ECMAScript 2015+ (ES6+) 코드를 이전 버전의 JavaScript로 변환해주는 도구입니다. ECMAScript 2015 이후에는 새로운 JavaScript 기능과 구문이 계속 추가되고 있지만, 모든 브라우저와 환경에 이러한 새로운 기능을 지원하지 않을 수 있습니다. Babel은 이러한 새로운 기능을 사용하여 작성된 코드를 이전 버전의 JavaScript로 변환하여 다양한 환경에서 실행할 수 있도록 도와줍니다. # Babel의 필요성 Node.js에서 Babel은 최신 JavaScript 기능을 사용하여 코드를 작성할 수 있게 해주고, 이를 이전 버전으로 변환하여 다양한 환경에서 실행할 수 있도록 도와주는 도구입니다. 프론트엔드 및 백앤드 개발에서 널리 사용..
-
#TIL_npm, npx, yarn 고놈이 고놈 아닌가? 셋의 차이점을 빠르게 알아보자!.!TIL (Today I Learned) 2023. 11. 21. 00:17
npm, npx, yarn은 JavaScript 패키지 관리 도구로, 프로젝트의 의존성을 관리하고 Script 실행을 돕는데 사용됩니다. # npm(Node Package Manager) Node.js 패키지를 설치하고 관리하는데 사용되는 기본 패키지 매니저입니다. Node,js를 설치할 때 함께 제공되며, JavaScript 라이브러리와 프레임워크를 설치하고 관리하는데 사용됩니다. package.json 파일을 사용하여 프로젝트의 의존성 및 스크립트를 관리합니다. npm install // 패키지 설치 npm install -g //전역 패키지 설치 npm run // 스크립트 실행 # npx(NodePackage eXecute) npm 패키지 중 하나로, npm 5.2.0 버전부터 기본적으로 함께 제..
-
#TIL_RDS 인스턴스를 생성 안내서TIL (Today I Learned) 2023. 11. 18. 00:09
# RDS란? AWS RDS(관계형 데이터베이스 서비스)는 Amazon Web Services의 클라우드 기반 관리 및 관계형 데이터베이스 서비스입니다. RDS를 사용하면 데이터베이스 관리 작업을 단순화할 수 있으며, 사용자는 데이터베이스 관리와 유지보수에 신경 쓰지 않고도 다양한 관계형 데이터베이스 엔진을 실행할 수 있습니다. 또한, 자동화된 백업, 복원, 확장성 및 보안 설정과 같은 여러 기능을 제공하여 안정적이고 확장 가능한 데이터베이스 솔루션을 구축할 수 있도록 도와줍니다. 이제 생성하는 방법을 시작해보겠습니다. # RDS 인스턴스 생성 방법 ** AWS 홈페이지에 접속하여 회원가입을 진행 합니다. 무료 클라우드 컴퓨팅 서비스 - AWS 프리 티어 Q: AWS 프리 티어란 무엇입니까? AWS 프리..
-
#TIL_과제하다가 뇌절하고 써보는 nodemon오류에 관하여?.?TIL (Today I Learned) 2023. 11. 15. 00:33
# 노태식(nodemon)이 너냐? nodemon은 노드 서버를 자동으로 열고 닫아주는 간편한 친구입니다. node.js를 매번 onoffon 할 필요없이 번거로운 작업을 줄여주는 아주 귀여운 친구이기 때문에 사용할 것을 적극적으로 권장드립니다. # 오늘도 평화로운 하루를 보내며 열씨미 과제를 하던 중 Nodemon이라는 것을 접하게 되어 실행해보기로 했습니다. # 우선 vsc를 켜고 파일을 만들어 npm을 다운 받습니다. npm i nodemon package.json에서도 설치가 잘 되었는지 눈 도장 찍어줍니다. 혹시나 했는데 역시나 잘 설치가 되어있습니다. 근데 막상 nodemon 요놈을 실행하면 작동을 안하게 될 겁니다. 저도 처음에 작동을 안해서 당황했었는데 한번 찬찬히 보여드리겠습니다. # n..
-
#TIL_미들웨어에 대하여TIL (Today I Learned) 2023. 11. 14. 00:18
# 미들웨어란? 미들웨어는 Express.js 동작의 핵심입니다. 양 쪽을 연결하여 데이터를 주고 받을 수 있도록 중간에서 매개 역할을 하는 소트트웨어입니다. # 미들웨어의 동작원리 클라이언트에서 요청을 보내게 되면 서버에 있는 미들웨어들이 동작을 하게 됩니다. 요청이 들어오자마자 첫 번째 미들웨어를 거치게되고 미들웨어들 하나하나를 다 타고 들어가서 최종 미들웨어에서 응답을 보내면 그 응답이 클라이언트에게 전달되는 구조이며, 응답이 마무리될 때까지 미들웨어 동작 사이클이실행됩니다. 즉 서버가 모든 미들웨어들의 호출로 구성되어 있다는 것을 예측할 수 있게 됩니다. Express에서는 애플리케이션은 본질적으로 일련의 미들웨어 함수라고 정의하고 있습니다. # 미들웨어의 기본 작성예제 var express = ..
-
#TIL_트랜잭션(Transaction)에 대하여TIL (Today I Learned) 2023. 11. 10. 23:31
# 트랜잭션(Transaction)이란? 데이터베이스에서 원자성, 일관성, 고립성, 지속성(ACID)등의 속성을 보장하기 위해 수행되는 작업의 논리적 단위를 나타냅니다. 여러 트랜잭션은 동시에 실행될 수 있으며, 데이터베이스 시스템은 이러한 트랜잭션들을 관리하여 안전하고 일관된 데이터 상태를 유지합니다. **상태를 변화시키는 것은 SQL 질의어를 통해 DB에 접근하는 것입니다. - SELECT - INSERT - DELETE - UPDATE # 트랜잭션의 특징 1. 원자성 (Atomicity) 트랜잭션은 원자적인 단위로 간주되며, 트랜잭션내의 모든 연산은 성공하거나 실패합니다. 만약 어느 한 부분이라도 실패하면 전체 트랜잭션이 실패하고, 모든 변경 사항이 롤백되어 이전 상태로 돌아가게 됩니다. 2. 일관..