본문 바로가기

전체 글

(70)
[Lodash] _.groupBy() 함수 설명 및 사용 예제/예시 구문(Syntax) _.groupBy(collection, [iteratee=_.identity]) 각 수집 요소를 반복 실행한 결과에서 생성된 키로 구성된 개체를 만듭니다. 그룹화된 값의 순서는 수집에서 발생하는 순서에 따라 결정됩니다. 각 키의 해당 값은 키 생성을 담당하는 요소의 배열입니다. 반복자는 다음(value) 하나의 인수로 호출됩니다. Creates an object composed of keys generated from the results of running each element of collection thru iteratee. The order of grouped values is determined by the order they occur in collection. The c..
[Lodash] _.includes() 함수 설명 및 사용 예제/예시 구문(Syntax) _.includes(collection, value, [fromIndex=0]) 값이 컬렉션에 있는지 확인합니다. 컬렉션이 문자열이면 값의 서브스트링을 확인하고, 그렇지 않으면 동일성 비교를 위해 SameValueZero가 사용됩니다. FromIndex가 음수이면 컬렉션 종료 후 오프셋으로 사용됩니다. Checks if value is in collection. If collection is a string, it's checked for a substring of value, otherwise SameValueZero is used for equality comparisons. If fromIndex is negative, it's used as the offset from the ..
[Lodash] _.find() 함수 설명 및 사용 예제/예시 구문(Syntax) _.find(collection, [predicate=_.identity], [fromIndex=0]) 컬렉션의 요소를 반복하여 조건자(predicate)가 true를 반환하는 첫 번째 요소를 반환합니다. 조건자는 세 가지 인수(값, 인덱스|키, 컬렉션)를 사용하여 호출됩니다. Iterates over elements of collection, returning the first element predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection). 매개변수(Arguments) - collection (Array|Object): 검사할 컬렉션입니다...
[npm] 설정된 npm registry 확인하기 / 기본 npm registry 변경하기 설정된 npm registry 확인하기 npm config get registry 기본 npm registry 변경하기 npm config set registry https://xxx.xxx
[setcap/getcap] Linux에서 1024 이하 포트 사용하기 오늘 rhel 서버에서 80포트의 Node 서비스를 배포하였더니 접속이 안되는 문제가 발생했습니다. 기존에 5000 포트로 실행하였을 때는 정상이었는데 왜 80 포트로는 안되는지 찾아보던 중 linux 서버에서는 일반 사용자 계정이 1024이하 포트를 사용할 수 없다는 것을 알게되었습니다. Linux에서 1024 이하 포트 사용하기 Linux는 1024 이하 port를 서비스에 할당하기 위해서는 root 사용자 권한이 필요하다고 합니다. 하지만 setcap 명령어 사용하여 일반 사용자가 1024 이하 포트 사용이 가능합니다. setcap setcap 명령어로 1024 이하 포트를 사용할 파일에 CAP_NET_BIND_SERVICE를 설정해주면 됩니다. sudo /usr/sbin/setcap 'cap_ne..