json2yamlresume
json2yamlresume 是一個用於將 JSON Resume 轉換為 YAMLResume 格式的命令行工具。
功能
安裝
npm install -g json2yamlresume
pnpm add -g json2yamlresume
yarn global add json2yamlresume
bun add -g json2yamlresume
使用方法
將 JSON Resume 轉換為 YAMLResume
$ json2yamlresume input.json output.yaml
# 或者調用命令時不指定可選的輸出路徑,在這種情況下
# 輸出將寫入與輸入文件相同的目錄,使用相同的名稱但擴展名為 .yml
$ json2yamlresume input.json
顯示幫助
$ json2yamlresume --help
Usage: json2yamlresume [options] <input-file> [output-file]
Convert JSON Resume to YAMLResume format
Arguments:
input-file Input JSON Resume file path
output-file Output YAMLResume file path
Options:
-V, --version output the version number
-h, --help display help for command
顯示版本
$ json2yamlresume --version
0.7.4
示例
以下是 JSON Resume 格式的示例履歷:
{
"basics": {
"name": "John Doe",
"label": "Software Engineer",
"email": "john@example.com",
"location": {
"city": "San Francisco",
"countryCode": "US"
},
"profiles": [
{
"network": "GitHub",
"username": "johndoe",
"url": "https://github.com/johndoe"
}
]
},
"work": [
{
"name": "Tech Corp",
"position": "Senior Developer",
"startDate": "2020-01",
"summary": "Led development of web applications.",
"highlights": [
"Increased performance by 40%",
"Mentored 5 junior developers"
]
}
],
"education": [
{
"institution": "University of California",
"area": "Computer Science",
"studyType": "Bachelor of Science",
"startDate": "2018"
}
]
}
您可以調用以下命令將 JSON Resume 轉換為 YAMLResume:
$ json2yamlresume json-resume.json yamlresume.yml
以下是 YAMLResume 格式的輸出:
---
content:
basics:
name: John Doe
headline: Software Engineer
email: john@example.com
education:
- institution: University of California
area: Computer Science
degree: Bachelor of Science
startDate: "2018"
location:
city: San Francisco
country: US
profiles:
- network: GitHub
username: johndoe
url: https://github.com/johndoe
work:
- name: Tech Corp
position: Senior Developer
startDate: 2020-01
summary: |-
- Increased performance by 40%
- Mentored 5 junior developers
轉換規則
1. location/profiles 移動到頂級
basics.location
→ 頂級location
basics.profiles
→ 頂級profiles
basics.label
→basics.headline
2. education 欄位映射
education[].studyType
→education[].degree
3. highlights 合併到 summary 欄位
轉換器將 highlights
數組合併到這些章節的 summary
欄位中作為 markdown 無序列表:
work[]
volunteer[]
projects[]
示例:
{
"summary": "Led development team.",
"highlights": ["Increased performance", "Mentored developers"]
}
變為:
summary: |-
Led development team.
- Increased performance
- Mentored developers
請記住,YAMLResume 的 summary 欄位支援富文本!
4. references 欄位映射
references[].reference
→references[].summary
支援的 JSON Resume 章節
轉換器支援所有標準 JSON Resume 章節:
- ✅
basics
- ✅
work
- ✅
volunteer
- ✅
education
- ✅
awards
- ✅
certificates
- ✅
publications
- ✅
skills
- ✅
languages
- ✅
interests
- ✅
references
- ✅
projects
Edit on GitHub
Last updated on