core-node

Node.js utilities and file system operations

Node.js 유틸리티 및 파일 시스템 작업

GitHubNPM

Installation

Installs the package and its peer dependency

패키지와 필수 의존성을 설치하세요:

Demo example

DEMO EXAMPLE

데모 예제

File System Operations

File and directory manipulation utilities for Node.js

Node.js를 위한 파일과 디렉토리 조작 유틸리티

FileUtils

File operations and management

파일 작업 및 관리

OTHER FUNCTIONS기타 함수
  • writeFile(buffer: Buffer, config: {path?: string, originalName?: string}): Promise<File>Write buffer to file and return File instance버퍼를 파일에 쓰고 File 인스턴스 반환
  • path(path: string | string[]): stringJoin path array or return path string경로 배열 결합 또는 경로 문자열 반환
  • existsSync(path, config?: {existes?, noExistes?}): booleanCheck if file exists synchronously파일 존재 여부 동기적으로 확인
  • mkdirSync(path, config?: MakeDirectoryOptions): stringCreate directory synchronously디렉토리 동기적으로 생성
  • mkdir(path, config?: MakeDirectoryOptions): Promise<string>Create directory asynchronously디렉토리 비동기적으로 생성
  • readSync(path, config?: {option?}): string | BufferRead file synchronously파일 동기적으로 읽기
  • readAsync(path, config?: {option?}): Promise<Buffer>Read file asynchronously파일 비동기적으로 읽기
  • readStringSync(path): stringRead file as string synchronously파일을 문자열로 동기적으로 읽기
  • readStringAsync(path): Promise<string>Read file as string asynchronously파일을 문자열로 비동기적으로 읽기
  • read(path, config: {option}): Promise<Buffer>Read file with callback콜백으로 파일 읽기
  • write(data: string | Buffer, config: {path, options?}): Promise<void>Write data to file파일에 데이터 쓰기
  • writeAppend(data: string | Buffer, config: {path, options?}): Promise<void>Append data to file파일에 데이터 추가
  • deleteSync(path, config?: {options?}): voidDelete file synchronously파일 동기적으로 삭제
  • deleteDirSync(path, config?: {options?}): voidDelete directory synchronously디렉토리 동기적으로 삭제
  • readdir(path): Promise<string[]>Read directory contents디렉토리 내용 읽기
  • readFile(path): Promise<File>Read file and return File instance파일 읽기 및 File 인스턴스 반환

PathUtils

Path manipulation utilities

경로 조작 유틸리티

OTHER FUNCTIONS기타 함수
  • resolve(...paths)Resolve absolute path절대 경로 확인
  • parse(path)Parse path into object경로를 객체로 파싱
  • format(pathObject)Format path object to string경로 객체를 문자열로 포맷
  • isAbsolute(path)Check if path is absolute절대 경로 여부 확인
  • relative(from, to)Get relative path상대 경로 가져오기
  • normalize(path)Normalize path경로 정규화

System Information

System and process information utilities

시스템과 프로세스 정보 유틸리티

ProcessUtils

Process and system information

프로세스 및 시스템 정보

OTHER FUNCTIONS기타 함수
  • getArch()Get CPU architectureCPU 아키텍처 가져오기
  • getCwd()Get current working directory현재 작업 디렉토리 가져오기
  • getEnv(key)Get environment variable환경 변수 가져오기
  • setEnv(key, value)Set environment variable환경 변수 설정
  • getUptime()Get process uptime프로세스 가동 시간
  • getCpuUsage()Get CPU usageCPU 사용량 가져오기
  • getArgv(): string[]Get command line arguments명령줄 인자 가져오기
  • getTitle(): stringGet process title프로세스 제목 가져오기
  • isProduction(): booleanCheck if production environment프로덕션 환경 확인
  • isDevelopment(): booleanCheck if development environment개발 환경 확인
  • isTest(): booleanCheck if test environment테스트 환경 확인
  • getVersions(): NodeJS.ProcessVersionsGet Node.js and dependency versionsNode.js 및 의존성 버전 가져오기
  • exit(code?: number): voidExit process with code코드와 함께 프로세스 종료

MemoryUtils

Memory usage monitoring

메모리 사용량 모니터링

OTHER FUNCTIONS기타 함수
  • memoryUsage(): NodeJS.MemoryUsageGet memory usage information (rss, heapTotal, heapUsed, external, arrayBuffers)메모리 사용량 정보 가져오기 (rss, heapTotal, heapUsed, external, arrayBuffers)

Data Conversion

Data format conversion utilities

데이터 형식 변환 유틸리티

ConvertUtils

Buffer and string conversion

Buffer 및 문자열 변환

OTHER FUNCTIONS기타 함수
  • toString(data: string): stringConvert string to string (passthrough)문자열을 문자열로 변환 (통과)
  • toString(data: string | Buffer): stringConvert string or Buffer to string문자열 또는 Buffer를 문자열로 변환
  • toString(data: Buffer, config?: {encoding?, start?, end?}): stringConvert Buffer to string with encoding options인코딩 옵션으로 Buffer를 문자열로 변환
  • toBuffer(data: string, config?: {encoding}): BufferConvert string to Buffer (supports base64)문자열을 Buffer로 변환 (base64 지원)

Network Operations

HTTP and network operation utilities

HTTP와 네트워크 작업 유틸리티

HttpPageDownloader

HTTP page downloader for static site generation

정적 사이트 생성을 위한 HTTP 페이지 다운로더

OTHER FUNCTIONS기타 함수
  • constructor(baseUrl: string, httpFetcher?: HttpFetcher)Create HttpPageDownloader with base URL and optional HTTP fetcher기본 URL과 선택적 HTTP fetcher로 HttpPageDownloader 생성
  • download(route: string): Promise<string>Download HTML content from route라우트에서 HTML 콘텐츠 다운로드
  • downloadAndSave(outputDir: string, route: string): Promise<void>Download and save HTML to fileHTML 다운로드 후 파일로 저장
  • downloadAndSaveAll(outputDir: string, routes: string[]): Promise<void>Download and save multiple routes여러 라우트 다운로드 후 저장