# Bun - JavaScriptCore 기반의 빠른 JavaScript 런타임/트랜스파일러/NPM 클라이언트

> Clean Markdown view of GeekNews topic #6921. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=6921](https://news.hada.io/topic?id=6921)
- GeekNews Markdown: [https://news.hada.io/topic/6921.md](https://news.hada.io/topic/6921.md)
- Type: news
- Author: [ssssut](https://news.hada.io/@ssssut)
- Published: 2022-07-06T13:26:28+09:00
- Updated: 2022-07-06T13:26:28+09:00
- Original source: [bun.sh](https://bun.sh/)
- Points: 14
- Comments: 8

## Topic Body

- Node, Deno와 같은 JavaScript 런타임  
- 속도를 우선으로 개발  
  - npm run을 bun run으로 바꾸기만 해도 30배 빠르게 동작: https://twitter.com/jarredsumner/status/1454218996983623685  
- npm과 호환 가능한 패키지 매니저를 포함  
  - yarn을 bun install로 바꾸기만 해도 20배 빠르게 패키지 설치 가능:   
- WebKit에서 사용하는 JavaScriptCore을 확장하여 개발  
  - 시작 속도가 기존의 V8 등과 비교해서 월등히 빠름: https://twitter.com/jarredsumner/status/1499225725492076544  
- 기존에 돌리던 JavaScript/TypeScript 앱을 그대로 쓸 수 있도록 설계: N-API, fs, path, Buffer 등을 포함한 여러 node.js API 및 fetch, WebSocket, ReadableStream 등을 포함한 Web API를 네이티브로 구현  
- Node.js의 모듈 resolution 알고리즘을 구현하여 node_modules 사용 가능. ESM 및 CommonJS를 모두 지원. 내부적으로는 ESM을 사용.  
- 모든 파일이 트랜스파일되기 때문에 TypeScript 및 JSX를 모두 지원.  
- .env 파일로부터 환경 변수를 알아서 불러오기 때문에 더 이상 `require('dotenv').load()`를 쓸 필요가 없음.

## Comments



### Comment 11166

- Author: kunggom
- Created: 2022-07-07T21:32:06+09:00
- Points: 1

참고로 이 제품에 사용하려고 만들었다는 아카이브 포맷인 hop 또한 예전에 한번 소개된 적이 있습니다. 이것도 Zig 언어로 만들었더군요.  
[hop - tar보다 10배 빠른 아카이브 포맷](https://news.hada.io/topic?id=5373)

### Comment 11165

- Author: galadbran
- Created: 2022-07-07T20:06:21+09:00
- Points: 1

> Bun is written in , a low-level programming language with manual memory management.  
  
앗 처음 들어보는 언어로 구현이 되었군요!

### Comment 11185

- Author: wooseop
- Created: 2022-07-10T00:43:40+09:00
- Points: 2
- Parent comment: 11165
- Depth: 1

은근 인기를 얻어가는 언어인가 보더라구요.. 언어를 쓰지 않더라도 C/C++ 컴파일러로만 도입하는 경우도 꽤 있다는 것 같았어요

### Comment 11195

- Author: kunggom
- Created: 2022-07-10T22:59:54+09:00
- Points: 2
- Parent comment: 11185
- Depth: 2

참고: [Uber가 Zig를 사용하는 방법](https://news.hada.io/topic?id=6616)

### Comment 11164

- Author: galadbran
- Created: 2022-07-07T20:01:48+09:00
- Points: 1

> In bun.js, every file is transpiled. TypeScript & JSX just work.  
  
약간 deno 같은 접근이네요.   
스크립트 언어인데 빌드도구가 난립하는 상황도 참 희한한데 기본적으로 트랜스파일이 기본이라는것도 재미난 상황이라고 생각되어요 ㅎㅎ  
typescript 를 그냥 쓸 수 있는데 nodejs api 90% 호환이라고 하니 매력이 꽤 있어보입니다.   
(아직 0.1 인 것은 함정이지만)

### Comment 11156

- Author: alstjr7375
- Created: 2022-07-07T09:58:05+09:00
- Points: 1

어 코드도 공개가 되었군요?

### Comment 11148

- Author: gyarang
- Created: 2022-07-06T14:40:41+09:00
- Points: 3

프로젝트 아이콘이 국내 모 사이트를 떠오르게 하네요

### Comment 11152

- Author: seventeen
- Created: 2022-07-06T17:46:47+09:00
- Points: 1
- Parent comment: 11148
- Depth: 1

ㅋㅋㅋ
