https://caolan.uk/articles/writing-for-node-and-the-browser/
Writing for node and the browser
Modules that can be used both on the server and the client-side are a useful way to reuse code. This is one way of writing a module that will work well with both systems, while allowing you to write code in the familiar node style. In node you use module.e
caolan.uk
https://stackoverflow.com/questions/3225251/how-can-i-share-code-between-node-js-and-the-browser
How can I share code between Node.js and the browser?
I am creating a small application with a JavaScript client (run in the browser) and a Node.js server, communicating using WebSocket. I would like to share code between the client and the server. I...
stackoverflow.com
node와 브라우저에서 실행되는 js파일을 서로 공유하고 싶을때,
주로 공통 기능또는 자료구조 등이 명시된 코드 뭉치를 포함하는 js 파일이 될 것 인데
위 링크를 확인하면 구체적인 방법을 확일 할 수 있다.
'IT' 카테고리의 다른 글
Effective Typescript - 15 - 동적 데이터에 인덱스 시그니처 사용하기 (0) | 2022.01.21 |
---|---|
Effective Typescript - 14 - 타입 연산과 제네릭 사용으로 반복 줄이기. (0) | 2022.01.20 |
Effective Typescript - 13 - 타입과 인터페이스의 차이점 이해하기 (0) | 2022.01.20 |
Effective Typescript - 12 - 함수 표현식에 타입 적용하기. (0) | 2022.01.19 |
AWS EC2에 node.js 설치 및 node app 구동 (0) | 2021.05.02 |