CommonJS(CJS) 모듈 시스템과 ECMAScript (ESM) 모듈 시스템은 다른 JavaScript 모듈 시스템이며, 각각의 특징과 사용 방식이 다릅니다. 이 두 시스템의 주요 차이점은 다음과 같습니다:
1. CommonJS (CJS) 모듈:
const fs = require('fs');
const path = require('path');
module.exports = { ... };
2. ECMAScript 모듈 (ESM):
import fs from 'fs';
import path from 'path';
export { ... };
JavaScript 소숫점 다루기 (0) | 2024.03.26 |
---|---|
includes(), has(), size(), length() in JavaScript (0) | 2023.11.29 |
innerHTML, innerText, textContent 비교 (0) | 2023.08.27 |
cheerio 와 puffeteer 의 사용법 및 장단점 (0) | 2023.08.27 |
puffeteer - $$eval(), $eval() (0) | 2023.08.26 |