- ๊ฐ์
ํ๊ธฐ
https://www.npmjs.com/
npm | Home
Bring the best of open source to you, your team, and your company Relied upon by more than 17 million developers worldwide, npm is committed to making JavaScript development elegant, productive, and safe. The free npm Registry has become the center of Java
www.npmjs.com
๋จผ์ npm ํจํค์ง ๋ฐฐํฌ๋ฅผ ์ํด npm ์ฌ์ดํธ์ ๊ฐ์ ์ด ๋์ด ์์ด์ผ ํ๋ค.
2.
$ mkdir [๋๋ ํ ๋ฆฌ๋ช
]
$ cd [๋๋ ํ ๋ฆฌ๋ช
]
$ npm init
npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (temp) [ํจํค์ง๋ช
]
version: (1.0.0) 0.1.0
description: [๋ด์ฉ]
entry point: (index.js)
test command:
git repository:
keywords: [์ค๋ช
]
author: [์ค๋ช
]
license: (ISC)
About to write to /home/desktop/code/temp/package.json:
{
"name": "[ํจํค์ง๋ช
]",
"version": "0.1.0",
"description": "[๋ด์ฉ]",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"[์ค๋ช
]"
],
"author": "[์ค๋ช
]",
"license": "ISC"
}
Is this OK? (yes)
๋ง๋ค๊ณ ์ ํ๋ ํจํค์ง๋ช ์ ์ ๋ ฅํ์ฌ ๋ด์ฉ๋ค์ ๊ธฐ์ฌํ๋ค.
$ touch index.js
$ touch README.md
$ ls
README.md index.js package.json
3.
- npm install -g <ํจํค์ง๋ช > ์ผ๋ก ์ค์นํ๊ณ <ํจํค์ง๋ช > ์ผ๋ก ์คํ๋๋ ํ๋ก๊ทธ๋จ์ ๋ง๋ฌ
- ํ๋ก๊ทธ๋จ ์คํ ์ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ 1์ค๋ก "hello <์ด๋ฆ>" ์ผ๋ก ํ์
4. ์ ๊ท ๋ ํฌ์งํ ๋ฆฌ๋ฅผ ์์ฑํ์ฌ git ์ฐ๊ฒฐ์ ์งํ
- git init
5. TEST
# ์ค์น(ํ
์คํธ๋ฅผ ์ํ)
$ npm install -g ./
# ์ค์น ํ์ธ
$ npm list -g
# ์คํ
$ [ํจํค์ง๋ช
]
or
# ๋จ์ผ ์คํ
$ node index.js
hello pysatellte
6. npm ์ฌ๋ฆฌ๊ธฐ
$ npm login
//๋ฐฐํฌ
$ npm publish
๊ฐ๋ ์ ๋ก๋ ์ค๋ฅ๊ฐ ๊ฑธ๋ฆฌ๋ ๊ฒฝ์ฐ๋ ์๋ค๊ณ ํ๋ค.
๊ธฐ๋ค๋ฆฌ๋ฉด ํด๊ฒฐ๋จ.
์ด์ ๋ถํฐ ๋ง๋ค์ด๋ณด๊ณ ์ถ๋ npm ํจํค์ง! ๋๋ ์ฌ๊ธฐ์ ์ฌ๋ ค๋ด์ ๋ฟ๋ปํ๊ณ ์ฌ๋ฐ์๋ค.
๋จ์ง ์ฝ์ ๋ฉ์ธ์ง ํ๋์ผ๋ฟ์ด์ง๋ง ์ฆ๊ฒ๊ฒ ์งํํ๋ค.
์ ๋ง๋ก ๊ถ๊ธํ๊ธฐ์ ์ข์ ๊ฒฝํ๊ณผ ์์ ์๊ฐ์ด์๋ค.
'js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
js ํฌ๋กฌ ๊ณต๋ฃก ๊ฒ์ ๋ง๋ค๊ธฐ (2) (0) | 2024.07.09 |
---|---|
js ํฌ๋กฌ ๊ณต๋ฃก ๊ฒ์ ๋ง๋ค๊ธฐ (1) (0) | 2024.07.06 |
์น ํ์ด์ง์ lottie ํ์ผ ์ ์ฉํด๋ณด๊ธฐ (0) | 2023.06.20 |
Js, lastindexof ์ substring ์ ์ด์ฉํ์ฌ ํ์ผ ํ์ฅ์ ์ถ์ถํ๊ธฐ (0) | 2023.05.24 |
swiper ๋ง์ฐ์ค ์ฌ๋ ธ์ ๋ ์ฌ๋ผ์ด๋ ์ผ์์ ์ง autoplay stop (0) | 2023.05.02 |