All'alba vincerò

At dawn, I will win!

기타

npm 사용하기

나디아 Nadia 2024. 3. 16. 14:15

📌 npm

: node package manager

 

 

 

📌 라이브러리 설치하기

1. npm로 설치하기

npm i randomcolor
  • package.json 파일의 "dependencies"에 라이브러리가 추가됨 

2. import문 추가하기

import 작명 from "라이브러리명";

import randomColor from "randomcolor";

const color = randomColor();
console.log(color)

 

 

* 라이브러리 재설치

npm i
  • package.json/package-lock.json가 삭제되면 재설치하면 됨

 

 

 

📌 npx mrm gitignore

: .gitignore 파일 자동으로 생성하는 명령어

* .gitignore: 버전관리에서 제외하는 파일

 

 

📌 문법 검사 라이브러리

 

Getting Started | HTMLHint

1\. Use npm to install HTMLHint:

htmlhint.com

 

1. npm install로 설치 (홈페이지 참고)

2. playground에서 조건 설정 후 다운로드

3. 'htmlhintrc' 파일을 사용할 파일로 이동시킴

4. 명령어 사용

npx htmlhint "패키지명/파일명.html" : 특정 파일 문법 검사하기
npx htmlhint "**/*.html" : 모든 파일 검사하기

 

 

 


 

출처

한입 크기로 잘라먹는 리액트