관리 메뉴

Silver Library (Archived)

nodejs 로 영상 사이트 구현하기 - EP 3 본문

Personal DB/Unclassified record

nodejs 로 영상 사이트 구현하기 - EP 3

Chesed Kim 2021. 2. 19. 11:30
반응형

[Note: from now on, this section may link to express]

What is babel? babel is a JS compiler. Basically, a tool to convert JS thing to backend like.

babeljs.io/docs/en/

 

Babel · The compiler for next generation JavaScript

The compiler for next generation JavaScript

babeljs.io

What is babel/preset-env? A Good source to refer this is here.

velog.io/@pop8682/%EB%B2%88%EC%97%AD-%EC%99%9C-babel-preset%EC%9D%B4-%ED%95%84%EC%9A%94%ED%95%98%EA%B3%A0-%EC%99%9C-%ED%95%84%EC%9A%94%ED%95%9C%EA%B0%80-yhk03drm7q

 

[번역] babel-preset-env는 무엇이고 왜 필요한가?

이 글은 blog.jakoblind.no에서 작성한 What is babel-preset-env and why do I need it?을 번역/요약한 내용입니다. 모던 javascript 프로젝트를 시작할 때, babel을 설치하고 babel-preset-env plugin 설정을 .babelrc에서 하였

velog.io

Additionally, what is ES6?

(note: some sort of template format to support each different browser to understand the JS code)

(Most conservative countries or businesses will use the legacy one. So, convert/use ES5 for this case. Otherwise, good to go for ES6. Recent one is ideal.)

www.educba.com/what-is-es6/

 

What is ES6? | How does ES6 make Working so Easy?

Guide to  What is ES6?. Here we have also discussed the features along with the Advantages and Disadvantages of ES6. how it helps you in your career.

www.educba.com

 

After installing 'npm install @babel/preset-env', you need to edit package.json file.

The reason is; to let babel to execute the index.js file. Then it'd execute nodejs.

 

Function to const variable

By re-organising the existing function to const variable with arrow mark as above, this is called 'arrow function.'

 

If some installation 'npm install whatever' is not useful for website (regard to capacity),

then install it as 'npm install whatever -D'

 

This will only install in the sector of developing area. This will not be included on the git/github repository you designated (Caution advised: Not sure).

 


'npm install nodemon' will allows you to automatically restart the server whenever you save any file.

This is the thing not used for user nor web itself. So, better install it with '-D' after nodemon. Keep it for developer only.