Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
Today
Total
관리 메뉴

leebom

[유투브 클론] #5 NODEJS - using Babel 본문

스터디/개인스터디(유투브 드림코딩 by엘리)(주5회)

[유투브 클론] #5 NODEJS - using Babel

d0201d 2020. 11. 12. 16:42

Babel이란?

가장 최신의 코드를 표준 코드(무난하게 사용되고 있는 코드)로 변환시켜줌

 

babeljs.io/

 

Babel · The compiler for next generation JavaScript

The compiler for next generation JavaScript

babeljs.io

 

 

ES6(arrow function)

// ex)
// function handleProfile(req, res) {
//     res.send('your are on my profile')

const handleLisening = () =>  console.log(`Listening on: http://localhost:${PORT}`);  //arrow function

const  handleHome = (req, res) =>  res.send('hello from my cccc ');

const  handleProfile = (req, res) =>   res.send('your are on my profile');  

 

 

 

nodemon

소스 수정시 자동으로 재시작해줌

www.npmjs.com/package/nodemon

 

nodemon

Simple monitor script for use during development of a node.js app.

www.npmjs.com

{
  "name": "wetube",
  "version": "1.0.0",
  "description": "Cloning Youtube with Vanills and NodeJS",
  "author": "lee bom",
  "license": "ISC",
  "dependencies": {
    "@babel/core": "^7.12.3",
    "@babel/node": "^7.12.6",
    "@babel/preset-env": "^7.12.1",
    "express": "^4.17.1"
  },
  "scripts": {
    "start": "nodemon --exec babel-node index.js"
  },
  "devDependencies": {
    "nodemon": "^2.0.6"
  }
}

/package.json

 

github.com/leebom21/Wetube

 

leebom21/Wetube

Cloning Youtube with Vanills and NodeJS. Contribute to leebom21/Wetube development by creating an account on GitHub.

github.com

 

Comments