packagejson npm - ChoDragon9/posts GitHub Wiki
name
- μ΄λ¦μ 214μ μ΄ν
- scopeκ° μ§μ λ ν¨ν€μ§μ μ΄λ¦μ μ λλ λ°μ€λ‘ μμν μ μλ€.
- scope μμ΄λ νμ©λμ§ μλλ€.
- λλ¬Έμκ° μμ΄μΌ νλ€.
- μ΄λ¦μ URLμ μΌλΆ, λͺ λ Ήμ€μ μΈμ λ° ν΄λ μ΄λ¦μ΄ λλ―λ‘ μ΄λ¦μ URLμ μμ νμ§ μλ λ¬Έμκ° ν¬ν¨λ μ μλ€.
- Node λͺ¨λμ μ½μ΄μ κ°μ μ΄λ¦μ μ¬μ©νλ©΄ μλλ€.
- μ΄λ¦μ
js
λλnode
λ₯Ό λ£μΌλ©΄ μλλ€.engines
μ νμλ₯Ό νλ€.
version
λ²μ μ npmκ³Ό ν¨κ» λ²λ€λ‘ μ 곡λλ node-semverλ‘ κ΅¬λ¬Έ λΆμν μ μμ΄μΌ νλ€.
description
νλ‘μ νΈμ μ€λͺ
μ λ¬Έμμ΄λ‘ μμ±νλ€. npm search
λ‘ ν¨ν€μ§λ₯Ό μ°Ύμ μ μλ€.
keyword
νλ‘μ νΈμ ν€μλλ₯Ό λ¬Έμμ΄μ λ°°μ΄λ‘ μμ±νλ€. npm search
λ‘ ν¨ν€μ§λ₯Ό μ°Ύμ μ μλ€.
homepage
νλ‘μ νΈμ URLμ μμ±νλ€.
bugs
νλ‘μ νΈμ μ΄μ νΈλ컀μ λν URL λ° μ΄μλ₯Ό λ³΄κ³ ν΄μΌ νλ μ΄λ©μΌ μ£Όμλ₯Ό μμ±νλ€.
URLλ§ μμ± κ°λ₯νλ€. URLμ΄ μ 곡λλ©΄ npm bugs
λͺ
λ Ήμ΄λ‘ URLλ‘ μ΄λν μ μλ€.
{
"url" : "https://github.com/owner/project/issues",
"email" : "[email protected]"
}
license
ν¨ν€μ§μ λν λΌμ΄μΌμ€λ₯Ό μ§μ νλ€. μ΄μμ μΌλ‘λ [OSI](https://opensource.org/licenses/alphabetical μΉμΈμ λ°μ κ²μ μ νν΄μΌ νλ€.
author, contributors
author
μ νλͺ
λ§ μμ±νλ€. contributors
λ λ°°μ΄λ‘ μ¬λ €λͺ
μ μμ±νλ€.
μ 보λ name
, email
, url
μ μμ±νλ€.
{
"name" : "Barney Rubble",
"email" : "[email protected]",
"url" : "http://barnyrubble.tumblr.com/"
}
funding
ν¨ν€μ§ κ°λ° μκΈ μ§μ λ°©λ²μ λν μ΅μ μ 보λ₯Ό μ 곡νλ€.
files
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files
main
μ¬μ©μκ° ν΄λΉ ν¨ν€μ§λ₯Ό require("foo")
κ³Ό κ°μ΄ μ¬μ©ν λ μ§μ
νλ λͺ¨λ μ 보λ€.
ν¨ν€μ§ ν΄ν°μ 루νΈμμ μλκ²½λ‘λ‘ λͺ¨λμ μ§μ νλ€.
browser
λͺ¨λμ΄ ν΄λΌμ΄μΈνΈμΈ‘μμλ§ μ¬μ©λλλ‘ μλν κ²½μ° main λμ browserλ₯Ό μ¬μ©ν΄μΌ νλ€. Node.jsμμ μ¬μ©ν μ μλ λͺ¨λμμ μ릴 μ μλ€.
bin
ν¨ν€μ§μ PATHμ μ€μΉν΄μ μ€ννκ³ μΆμ νμΌμ΄ μμ κ²μ΄λ€. npmμ μ½κ² λ§λ€ μ μλλ‘ μ 곡νλ€.
bin
μ μ΄λ¦κ³Ό νμΌμ 맀ννλ©΄ ν¨ν€μ§κ° μ€μΉλ λ, prefix/bin
λλ ./node_modules/.bin/
μ symlinkλ₯Ό νλ€.
{
"bin": {
"myapp": "./cli.js"
}
}
man
man νλ‘κ·Έλ¨μ΄ μ°Ύμ μ μλλ‘ λ¨μΌ νμΌ λλ λ°°μ΄λ‘ μ§μ νλ€.
directories
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#directories
repository
ν¨ν€μ§μ μ μ₯μλ₯Ό μμ±ν μ μκ²νλ€.
"repository": {
"type" : "git",
"url" : "https://github.com/npm/cli.git"
}
"repository": {
"type" : "svn",
"url" : "https://v8.googlecode.com/svn/trunk/"
}
package.json
μ΄ ν¨ν€μ§ 루νΈμ μμΌλ©΄ directory
λ₯Ό μ§μ νλ€.
"repository": {
"type" : "git",
"url" : "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
}
scripts
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#scripts
config
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#config
dependencies
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#dependencies
devDependencies
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#devdependencies
peerDependencies
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependencies
bundledDependencies
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#bundleddependencies
optionalDependencies
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#optionaldependencies
engines
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#engines
os
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#os
cpu
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#cpu
private
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#private
publishConfig
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig
workspaces
https://docs.npmjs.com/cli/v7/configuring-npm/package-json#workspaces