250x250
Rainbow🌈Coder
My dev Note📒
Rainbow🌈Coder
전체 방문자
오늘
어제
  • 분류 전체보기 (411)
    • 공지사항 (0)
    • Debugger (10)
      • Visual Studio Debugger (1)
      • Chrome DevTools (3)
      • Visual Studio Code Debugger (4)
      • eclipse (1)
      • intelliJ (1)
    • OOP (2)
      • OOP (2)
    • TypeScript (54)
      • 타입스크립트 TypeScript (54)
    • Javascript (87)
      • Javascript (45)
      • Node.js (19)
      • React (5)
      • FE 개발환경설정 (3)
      • React와 Node 같이 때려잡기 (6)
      • next.js (2)
      • pixi.js (7)
    • 마크업 (23)
      • Html & Css (23)
    • C# (80)
      • C# (12)
      • 이것이 C#이다 (68)
    • C++ (30)
      • c++ (27)
      • win api (3)
    • Unity (18)
      • Unity(기초) (8)
      • Unity(C#중급) (5)
      • 유니티 포톤(네트워크) (4)
      • unity c# MyCode (1)
    • Java & Spring (29)
      • Java (11)
      • 스프링 (8)
      • Java Algorithm (9)
      • Javs Data Structures (1)
    • 자료구조와 알고리즘 (15)
      • 자료구조 (5)
      • 알고리즘 (10)
    • 형상관리 (15)
      • Git (11)
      • 소스트리 (3)
    • 그래픽스 (7)
      • WebGl (7)
    • AWS (3)
      • aws (3)
    • 리눅스 (5)
      • 리눅스 (5)
    • 책 리뷰 (13)
      • 클린코드(책리뷰) (3)
      • 유지보수가능한코딩의기술C#편(책리뷰) (1)
      • 리팩토링(자바스크립트판) (9)
    • Server (2)
      • 게임 서버(네트워크, 멀티쓰레드,OS) (2)
    • 설계, 아키텍쳐 (4)
    • 파이썬 (5)
    • 디자인패턴 (2)
    • mocha (2)
    • Jest (1)
    • Spine (1)
    • 인공지능 (1)
      • 혼자공부하는머신러닝+딥러닝 (1)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 컴포지션
  • 위임
  • ㅣㄷ
  • MySQL

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
Rainbow🌈Coder

My dev Note📒

Javascript/Node.js

[Node.js] global

2022. 5. 14. 01:31
728x90

Global objects | Node.js v16.15.0 Documentation (nodejs.org)

 

Global objects | Node.js v16.15.0 Documentation

Global objects# These objects are available in all modules. The following variables may appear to be global but are not. They exist only in the scope of modules, see the module system documentation: The objects listed here are specific to Node.js. There ar

nodejs.org

console.log(global);

브라우저에서는 window가 글로벌 객체이고,

node.js에서는 global 이 글로벌 객체이다.

C:\Users\User\gitprogect\NodeJs> node 1-global/app
<ref *1> Object [global] {
  global: [Circular *1],
  clearInterval: [Function: clearInterval],
  clearTimeout: [Function: clearTimeout],
  setInterval: [Function: setInterval],
  setTimeout: [Function: setTimeout] {
    [Symbol(nodejs.util.promisify.custom)]: [Getter]
  },
  queueMicrotask: [Function: queueMicrotask],
  performance: Performance {
    nodeTiming: PerformanceNodeTiming {
      name: 'node',
      entryType: 'node',
      startTime: 0,
      duration: 82.2766999900341,
      nodeStart: 1.1915000081062317,
      v8Start: 4.617000013589859,
      bootstrapComplete: 58.125800013542175,
      environment: 25.251300007104874,
      loopStart: -1,
      loopExit: -1,
      idleTime: 0
    },
    timeOrigin: 1652455410843.36
  },
  clearImmediate: [Function: clearImmediate],
  setImmediate: [Function: setImmediate] {
    [Symbol(nodejs.util.promisify.custom)]: [Getter]
  }
}

 

global.hello = () => {
  console.log("hello");
};
global.hello(); //hello
hello(); //hello

 

global.hello = () => {
    global.console.log("hello");
};
global.hello(); //hello
hello(); //hello
728x90

'Javascript > Node.js' 카테고리의 다른 글

[Node.js] 클라이언트와 서버의 개념, AWS 클라우드 서버 환경 구축 실습  (0) 2022.05.14
[Node.js] 백엔드 개념 기초 영상모음  (0) 2022.05.14
[node.js] 초간단 서버 만들기 (2) Node + Express 웹서버 기본세팅  (0) 2022.05.14
[Node.js] console.log  (0) 2022.05.14
node.js 초간단 서버 만들기 (1) express 라이브러리 설치  (0) 2022.03.18
    'Javascript/Node.js' 카테고리의 다른 글
    • [Node.js] 백엔드 개념 기초 영상모음
    • [node.js] 초간단 서버 만들기 (2) Node + Express 웹서버 기본세팅
    • [Node.js] console.log
    • node.js 초간단 서버 만들기 (1) express 라이브러리 설치
    Rainbow🌈Coder
    Rainbow🌈Coder
    몰라도 결국은 아는 개발자, 그런 사람이 되기 위한 매일의 한걸음

    티스토리툴바