
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
markdown-to-docx
Advanced tools
마크다운 파일을 Word(DOCX) 포맷으로 변환합니다. 라이브러리로도 사용 가능하며 CLI 도구로도 사용할 수 있습니다. TypeScript로 작성되어 완벽한 타입 안정성을 제공합니다.
code 완벽 지원[텍스트](URL) 형식 지원 형식 지원- [ ], - [x] 형식 지원<br/>, <hr/> 등 HTML 태그 자동 처리nodejs.org에서 다운로드 후 설치
npm install -g markdown-to-docx
# 저장소 클론
git clone https://github.com/your-username/markdown-to-docx.git
cd markdown-to-docx
# 의존성 설치 및 빌드
npm install
npm run build
# 전역 등록
npm link
# 기본 사용 (input.md → output.docx)
markdown-to-docx
# 파일명 지정
markdown-to-docx --input "마크다운파일.md"
# 폰트 변경
markdown-to-docx --font "나눔고딕"
# 모든 옵션
markdown-to-docx --input "문서.md" --output "결과.docx" --font "Arial"
npx markdown-to-docx --input "파일.md"
npm start
npm start -- --input "마크다운파일.md"
npm start -- --font "나눔고딕"
npm start -- --input "source.md" --output "result.docx"
npm start -- --input "문서.md" --output "결과.docx" --font "Arial"
npm run dev -- --input "파일.md"
또는
npx ts-node src/cli.ts --input "파일.md"
const { convertMarkdownToDOCX } = require("markdown-to-docx");
convertMarkdownToDOCX("input.md", "output.docx", {
fontFamily: "맑은 고딕",
verbose: true,
})
.then(() => console.log("완료!"))
.catch((error) => console.error(error));
const fs = require("fs");
const { parseMarkdown, DocxBuilder } = require("markdown-to-docx");
// 마크다운 파싱
const content = fs.readFileSync("input.md", "utf-8");
const elements = parseMarkdown(content, { verbose: true });
// 커스텀 빌더 생성
const builder = new DocxBuilder("Arial");
// 요소 추가
elements.forEach((element) => {
builder.addElement(element);
});
// 파일 저장
builder.save("output.docx");
import { convertMarkdownToDOCX } from "markdown-to-docx";
async function main() {
const outputFile = await convertMarkdownToDOCX("input.md", "output.docx", {
fontFamily: "맑은 고딕",
verbose: true,
});
console.log(`완료: ${outputFile}`);
}
main().catch(console.error);
import { parseMarkdown, DocxBuilder } from "markdown-to-docx";
import * as fs from "fs";
async function main() {
// 마크다운 파싱
const content = fs.readFileSync("input.md", "utf-8");
const elements = parseMarkdown(content, { verbose: true });
// 커스텀 빌더 생성
const builder = new DocxBuilder("Arial");
// 요소 추가
elements.forEach((element) => {
builder.addElement(element);
});
// 파일 저장
await builder.save("output.docx");
}
main().catch(console.error);
# 로컬 npm link
cd markdown-to-docx
npm link
# 다른 프로젝트에서
npm link markdown-to-docx
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
**굵은 텍스트** → Bold
_기울임 텍스트_ → Italic
`코드 블록` → Code (Consolas 폰트, 배경색)
- 항목 1
- 항목 2
- 중첩 항목 2-1
- 중첩 항목 2-2
- 항목 3
- [ ] 미완료 작업
- [x] 완료된 작업
마크다운 표준 테이블 형식을 지원합니다. 구분선은 다양한 형식이 가능합니다.
| 열1 | 열2 | 열3 |
| ------ | ------ | ------ |
| 데이터 | 데이터 | 데이터 |
| 데이터 | 데이터 | 데이터 |
지원하는 구분선 형식:
| --- | --- | --- || - | - | - || - | --- | ----- || :--- | :---: | ---: || 좌측 정렬 | 중앙 정렬 | 우측 정렬 |
| :-------- | :-------: | --------: |
| 왼쪽 | 가운데 | 오른쪽 |
[링크 텍스트](https://example.com)

> 이것은 인용문입니다.
> 파란색 테두리와 회색 배경으로 표시됩니다.
첫 번째 줄<br/>두 번째 줄 → 줄바꿈 처리
텍스트<hr/>텍스트 → 구분선 처리
<!-- 주석 --> → 주석 제거
<div>...</div> → 태그 제거, 내용만 유지
markdown-to-docx/
├── src/ # TypeScript 소스
│ ├── index.ts # 메인 진입점 & 라이브러리 API
│ ├── cli.ts # CLI 진입점
│ ├── markdownParser.ts # 마크다운 파싱
│ ├── inlineFormatter.ts # 인라인 포맷팅 (bold, italic, link 등)
│ └── docxBuilder.ts # DOCX 문서 생성
├── dist/ # 컴파일된 JavaScript (npm run build로 생성)
│ ├── index.js, index.d.ts # - npm 배포 시 포함
│ ├── cli.js, cli.d.ts
│ ├── markdownParser.js, markdownParser.d.ts
│ ├── inlineFormatter.js, inlineFormatter.d.ts
│ └── docxBuilder.js, docxBuilder.d.ts
├── examples/ # 사용 예제
│ ├── basic-usage.ts # TypeScript 기본 사용 예제
│ ├── advanced-usage.ts # TypeScript 고급 사용 예제
│ └── ts-usage.ts # TypeScript 라이브러리 사용 예제
├── tests/ # 테스트 마크다운 파일
│ ├── test_features.md
│ ├── test_formatting.md
│ └── test_html.md
├── build/ # 생성된 DOCX 파일 (git 제외)
├── tsconfig.json # TypeScript 설정
├── eslint.config.cjs # ESLint 설정 (v9+)
├── .prettierrc # Prettier 포맷팅 설정
├── .prettierignore # Prettier 제외 파일
├── package.json # 프로젝트 설정 & npm 스크립트
├── DEVELOPMENT.md # 개발자 문서
├── README.md # 이 파일
└── .gitignore
마크다운 파일을 DOCX로 변환합니다.
매개변수:
inputFile (string): 입력 마크다운 파일 경로outputFile (string): 출력 DOCX 파일 경로options (object): 옵션
fontFamily (string): 사용할 폰트 (기본값: '맑은 고딕')verbose (boolean): 상세 로그 출력 (기본값: true)반환값:
Promise<string>: 생성된 파일 경로예제:
await convertMarkdownToDOCX("input.md", "output.docx", {
fontFamily: "Arial",
verbose: true,
});
마크다운 텍스트를 파싱합니다.
매개변수:
content (string): 마크다운 텍스트options (object): 옵션
verbose (boolean): 상세 로그 출력 (기본값: true)반환값:
Array<Object>: 파싱된 요소 배열예제:
const elements = parseMarkdown(markdownText, { verbose: false });
DOCX 문서를 생성합니다.
메서드:
addElement(element): 요소 추가addHeading(element): 제목 추가addTable(element): 테이블 추가addBlockquote(element): 인용문 추가addCheckbox(element): 체크박스 추가addList(element): 목록 추가addParagraph(element): 단락 추가build(): 문서 생성save(outputFile): 파일 저장예제:
const builder = new DocxBuilder("Arial");
elements.forEach((el) => builder.addElement(el));
await builder.save("output.docx");
마크다운 파일이 동일한 디렉토리에 있는지 확인하세요.
# 파일 확인
dir *.md (또는 ls *.md)
# 파일명 지정
node cli.js --input "정확한파일명.md"
docx npm 패키지가 설치되었는지 확인하세요.
npm install docx
Word에서 설정한 기본 폰트가 다를 수 있습니다. 문서를 연 후 "모두 선택(Ctrl+A)"으로 폰트를 변경하세요.
# 버전 업데이트 (package.json의 version 필드)
npm version patch # or minor, major
# 빌드 및 테스트
npm run build
npm run lint
npm run format:check
# npm 로그인
npm login
# 배포
npm publish
# 최신 버전 설치
npm install -g markdown-to-docx
# 또는 특정 버전 설치
npm install -g markdown-to-docx@1.0.0
# 업그레이드
npm install -g markdown-to-docx@latest
# 기본 사용
markdown-to-docx --input "파일.md"
# 모든 옵션
markdown-to-docx --input "문서.md" --output "결과.docx" --font "Arial"
# 버전 확인
markdown-to-docx --version
npm install markdown-to-docx
JavaScript 또는 TypeScript 코드에서:
const { convertMarkdownToDOCX } = require("markdown-to-docx");
// 또는
import { convertMarkdownToDOCX } from "markdown-to-docx";
# 설치
npm install -g markdown-to-docx
# 사용
markdown-to-docx --input "meeting_notes.md" --output "회의록.docx"
# 저장소 클론
git clone https://github.com/your-username/markdown-to-docx.git
cd markdown-to-docx
# 설치 및 빌드
npm install
npm run build
# 전역 등록
npm link
# 사용
markdown-to-docx --input "파일.md"
# npm 패키지 설치
npm install markdown-to-docx
# Node.js 코드
const { convertMarkdownToDOCX } = require("markdown-to-docx");
BSD 3-Clause License - 자유로운 사용 및 배포 가능합니다.
자세한 내용은 LICENSE 파일을 참고하세요.
FAQs
마크다운 파일을 Word(DOCX) 문서로 변환합니다. 테이블, 링크, 이미지, 체크박스 등을 지원합니다.
We found that markdown-to-docx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.