🛠️ToolsShed

Package.json 생성기

Node.js 프로젝트를 위한 package.json 파일을 대화형으로 생성합니다.

PackageJsonGenerator.pairHint

PackageJsonGenerator.pairHint

자주 묻는 질문

코드 구현

import json

package = {
    "name": "my-package",
    "version": "1.0.0",
    "description": "A sample package",
    "main": "index.js",
    "author": "Your Name",
    "license": "MIT",
    "scripts": {
        "start": "node index.js",
        "test": "jest"
    },
    "dependencies": {
        "express": "^4.18.2"
    },
    "devDependencies": {
        "jest": "^29.0.0"
    },
    "keywords": ["sample", "node"]
}

with open("package.json", "w") as f:
    json.dump(package, f, indent=2)

print(json.dumps(package, indent=2))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.