🛠️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.