{"id":354436,"date":"2024-05-20T22:48:25","date_gmt":"2024-05-20T22:48:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=354436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=354436","title":{"rendered":"<span>\u0420\u0435\u043b\u0438\u0437 Bun 1.0 (\u043d\u043e\u0432\u044b\u0439 runtime \u0434\u043b\u044f JavaScript )<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7f8\/f92\/d07\/7f8f92d0778db2975f99708e5b0e5b9e.png\" width=\"2457\" height=\"1046\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f8\/f92\/d07\/7f8f92d0778db2975f99708e5b0e5b9e.png\"\/><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c Bun \u0432\u0435\u0440\u0441\u0438\u0438 1.0.<\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 JavaScript \u0438 TypeScript \u043a\u043e\u0434\u0430 (\u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043e fullstack-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f).\u00a0\u0421\u0435\u0433\u043e\u0434\u043d\u044f Bun \u0441\u0442\u0430\u0431\u0438\u043b\u0435\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0443.<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Bun<\/strong><\/p>\n<pre><code class=\"bash\"># curl curl -fsSL https:\/\/bun.sh\/install | bash # npm npm install -g bun # brew brew tap oven-sh\/bun brew install bun # docker docker pull oven\/bun docker run --rm --init --ulimit memlock=-1:-1 oven\/bun<\/code><\/pre>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Bun<\/strong><\/p>\n<pre><code class=\"bash\">bun upgrade<\/code><\/pre>\n<h3>Bun \u2014 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h3>\n<p>\u041c\u044b \u043b\u044e\u0431\u0438\u043c JavaScript.\u00a0\u041e\u043d \u0437\u0440\u0435\u043b\u044b\u0439, \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438 \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e.\u00a0\u042d\u0442\u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f Node.js \u043f\u0440\u043e\u0448\u043b\u043e 14 \u043b\u0435\u0442. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0433\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b  \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u043e\u0439 \u0437\u0430 \u0441\u043b\u043e\u0435\u043c.\u00a0\u0418 \u043a\u0430\u043a \u043b\u044e\u0431\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0442\u0435\u0442 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b JavaScript \u0441\u0442\u0430\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438.<\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 Bun \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442?<\/strong><\/p>\n<p>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430 &#8212; \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c,\u00a0<em>\u041d\u0415<\/em>\u00a0\u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u044f\u0441\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0432 JavaScript.\u00a0\u0412\u0430\u0448\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443. \u0412\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043a.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0430\u043c\u00a0<em>\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f<\/em>\u00a0\u043f\u043e\u0437\u0430\u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0411\u0430\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c\u0438:<\/p>\n<p><strong>Node.js.<\/strong> Bun \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 Node.js, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><code>node<\/code><\/p>\n<\/li>\n<li>\n<p><code>npx<\/code> &#8212; bunx \u0432 5 \u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/p>\n<\/li>\n<li>\n<p><code>nodemon<\/code> \u2014 Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 watch-\u0440\u0435\u0436\u0438\u043c<\/p>\n<\/li>\n<li>\n<p><code>dotenv<\/code>, <code>cross-env<\/code> &#8212; Bun \u0447\u0438\u0442\u0430\u0435\u0442 <code>.env<\/code> \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0422\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b.<\/strong> Bun \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u00a0<code>.js<\/code>,\u00a0<code>.ts<\/code>,\u00a0<code>.cjs<\/code>,\u00a0<code>.mjs<\/code>,\u00a0<code>.jsx<\/code>\u0438\u00a0<code>.tsx<\/code>\u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0441\u043e\u0431\u043e\u0439:<\/p>\n<ul>\n<li>\n<p><code>tsc<\/code> \u2014 (\u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432!)<\/p>\n<\/li>\n<li>\n<p><code>babel<\/code>, <code>.babelrc<\/code>, <code>@babel\/preset-*<\/code><\/p>\n<\/li>\n<li>\n<p><code>ts-node<\/code>, <code>ts-node-esm<\/code><\/p>\n<\/li>\n<li>\n<p><code>tsx<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0430\u043d\u0434\u043b\u0435\u0440\u044b. Bun \u2014 \u044d\u0442\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a JavaScript \u0441 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441 esbuild API \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<ul>\n<li>\n<p><code>esbuild<\/code><\/p>\n<\/li>\n<li>\n<p><code>webpack<\/code><\/p>\n<\/li>\n<li>\n<p><code>parcel<\/code>, <code>.parcelrc<\/code><\/p>\n<\/li>\n<li>\n<p><code>rollup<\/code>, <code>rollup.config.js<\/code><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/strong>\u00a0. Bun \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f npm-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438.\u00a0\u041e\u043d \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u0444\u0430\u0439\u043b\u00a0<code>package.json<\/code>\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0<code>node_modules<\/code>, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>npm<\/code>, <code>.npmrc<\/code>, <code>package-lock.json<\/code><\/p>\n<\/li>\n<li>\n<p><code>yarn<\/code>, <code>yarn.lock<\/code><\/p>\n<\/li>\n<li>\n<p><code>pnpm<\/code>, <code>pnpm.lock<\/code>, <code>pnpm-workspace.yaml<\/code><\/p>\n<\/li>\n<li>\n<p><code>lerna<\/code><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/strong> Bun \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Jest-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442-\u0440\u0430\u043d\u043d\u0435\u0440\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u043c\u043e\u043a\u043e\u0432 \u0438 code coverage, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b:<\/p>\n<ul>\n<li>\n<p><code>jest<\/code>, <code>jest.config.js<\/code><\/p>\n<\/li>\n<li>\n<p><code>ts-jest<\/code>, <code>@swc\/jest<\/code>, <code>babel-jest<\/code><\/p>\n<\/li>\n<li>\n<p><code>jest-extended<\/code><\/p>\n<\/li>\n<li>\n<p><code>vitest<\/code>, <code>vitest.config.ts<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0442\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0445\u043e\u0440\u043e\u0448 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c), \u0438\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u00a0\u041e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b;\u00a0\u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435\u00a0<code>jest<\/code>\u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u0440\u0448\u0435\u043d \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 3 \u0440\u0430\u0437!\u00a0\u0410 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b (\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0437\u043e\u043b\u0435\u043d\u0442\u0430 \u0441\u043e \u0441\u043a\u043e\u0442\u0447\u0435\u043c ?), \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u0437\u043d\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.\u00a0\u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0438\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 API.<\/p>\n<h3>Bun \u2014 \u044d\u0442\u043e \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript.<\/h3>\n<p>Bun \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript.\u00a0\u0415\u0433\u043e \u0446\u0435\u043b\u044c \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043c\u0435\u043d\u0435\u0435 \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p><strong>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Node.js<\/strong><\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 Node.js.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Node.js \u0438 \u043f\u0430\u043a\u0435\u0442\u044b npm\u00a0<em>\u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442<\/em>\u00a0\u0432 Bun.\u00a0Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Node.js APIs, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0<code>fs<\/code>, <code>path<\/code> \u0438 <code>net<\/code><\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0<code>__dirname<\/code> \u0438 <code>process<\/code><\/p>\n<\/li>\n<li>\n<p>\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 <code>node_modules<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0442\u044f\u00a0<em>\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f<\/em>\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Node.js \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 (\u0438\u0437-\u0437\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<code>node:v8<\/code>&#8212; <a href=\"https:\/\/nodejs.org\/docs\/latest-v20.x\/api\/v8.html\" rel=\"noopener noreferrer nofollow\">https:\/\/nodejs.org\/docs\/latest-v20.x\/api\/v8.html<\/a>), Bun \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Node.js.<\/p>\n<p>Bun \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 Node.js \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 npm.\u00a0\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Express, Koa \u0438 Hono, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.\u00a0\u041a\u0430\u043a \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0443\u043b\u0441\u0442\u0435\u043a \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.\u00a0\u0412 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438  Node.js API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/286\/c94\/b0a\/286c94b0a8b92b68055b4295d8a9fb6f.png\" alt=\"\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Next.js, Remix, Nuxt, Astro, SvelteKit, Nest, SolidStart \u0438 Vite, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Bun.\" title=\"\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Next.js, Remix, Nuxt, Astro, SvelteKit, Nest, SolidStart \u0438 Vite, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Bun.\" width=\"1233\" height=\"748\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/286\/c94\/b0a\/286c94b0a8b92b68055b4295d8a9fb6f.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Next.js, Remix, Nuxt, Astro, SvelteKit, Nest, SolidStart \u0438 Vite, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Bun.<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/strong><\/p>\n<p>Bun \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 4 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1499225725492076544\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.\u00a0\u042d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 TypeScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c Node.js \u0441\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff7\/606\/2b3\/ff76062b3891adf4ebfb0bd7664a36ee.png\" alt=\"\u0411\u0430\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 &quot;Hello, wolrd!&quot; \u043d\u0430 TypeScript \u0432 5 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Node.js \u0441 esbul.\" title=\"\u0411\u0430\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 &quot;Hello, wolrd!&quot; \u043d\u0430 TypeScript \u0432 5 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Node.js \u0441 esbul.\" width=\"1394\" height=\"602\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff7\/606\/2b3\/ff76062b3891adf4ebfb0bd7664a36ee.png\"\/><\/p>\n<div><figcaption>\u0411\u0430\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 &#171;Hello, wolrd!&#187; \u043d\u0430 TypeScript \u0432 5 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Node.js \u0441 esbul.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Node.js \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0432\u0438\u0436\u043a\u0430 V8 \u043e\u0442 Google, Bun \u0441\u043e\u0437\u0434\u0430\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c\u00a0\u0434\u0432\u0438\u0436\u043a\u0430 <a href=\"https:\/\/webkit.org\/\" rel=\"noopener noreferrer nofollow\">WebKit<\/a> (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 Apple). WebKit \u2014 \u044d\u0442\u043e \u0434\u0432\u0438\u0436\u043e\u043a, \u043b\u0435\u0436\u0430\u0449\u0438\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 Safari \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.\u00a0\u041e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u044f\u043c\u0438.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430. <\/em>\u0421\u0442\u043e\u0438\u0442 \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e bun \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043c\u043e\u043b\u043e\u0434\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/ziglang.org\/\" rel=\"noopener noreferrer nofollow\">Zig<\/a> (\u0435\u0449\u0435 \u0441\u0430\u043c \u043d\u0435 \u0434\u043e\u0448\u0435\u043b \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.0). Zig \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0442\u0443\u0436\u0435 \u043d\u0438\u0448\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0438 C\/C++ \u0438 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u043f\u043e\u0440 Rust.<\/p>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 TypeScript \u0438 JSX<\/strong><\/p>\n<p>\u0412 Bun \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b JavaScript, TypeScript \u0438 \u0434\u0430\u0436\u0435 JSX\/TSX \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code class=\"bash\">bun index.t # or bun index.tsx<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c ESM \u0438 CommonJS<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 <code>CommonJS<\/code> \u043a  <code>ES<\/code>-\u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0431\u044b\u043b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u0442\u044f\u0436\u0435\u043b\u044b\u043c.\u00a0\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f ESM Node.js \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c 5 \u043b\u0435\u0442 \u0434\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u0435\u0437\u00a0<code>--experimental-modules<\/code>\u0444\u043b\u0430\u0433\u0430.\u00a0\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u0430 <code>CommonJS<\/code>.<\/p>\n<p>Bun \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\u00a0\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (<code>.js<\/code>,\u00a0<code>.cjs<\/code>, <code>.mjs<\/code>), \u0438\u043b\u0438 \u043e <code>\"type\": \"module\"<\/code> \u0432 <code>package.json<\/code>.<\/p>\n<p>\u0412\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<code>import<\/code>\u0438\u00a0<code>require()<\/code>\u0432\u00a0<em>\u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u0436\u0435 \u0444\u0430\u0439\u043b\u0435.<\/em>\u00a0\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">import lodash from \"lodash\"; const _ = require(\"underscore\")<\/code><\/pre>\n<p><strong>\u0412\u0435\u0431-API<\/strong><\/p>\n<p>Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Web APIs, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0443\u0442\u0443\u043f\u043d\u044b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 (<code>fetch<\/code>,\u00a0<code>Request<\/code>,\u00a0<code>Response<\/code>,\u00a0<code>WebSocket<\/code>\u0438\u00a0<code>ReadableStream<\/code>).<\/p>\n<pre><code class=\"javascript\">const response = await fetch(\"&lt;https:\/\/example.com\/>\"); const text = await response.text()<\/code><\/pre>\n<p>\u0412\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u0430\u043a\u00a0<code>node-fetch<\/code>\u0438\u00a0<code>ws<\/code>.\u00a0\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 Web APIs  \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 Bun \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.<\/p>\n<p><strong>Hot reloading<\/strong><\/p>\n<p>Bun \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.\u00a0\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Bun \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\u00a0<code>--hot<\/code>, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 hot reloading, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<pre><code class=\"bash\">bun --hot server.ts<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>nodemon<\/code>, Bun \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434, \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0441\u0442\u0430\u0440\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f HTTP \u0438 WebSocket \u043d\u0435 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0413\u0438\u0444\u043a\u0430 \u043f\u0440\u043e hot reloading \u043b\u0435\u0436\u0438\u0442 \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/bun.sh\/hot.gif\" rel=\"noopener noreferrer nofollow\">https:\/\/bun.sh\/hot.gif<\/a><\/p>\n<p><strong>\u041f\u043b\u0430\u0433\u0438\u043d\u044b<\/strong><\/p>\n<p>Bun \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.\u00a0\u041f\u043b\u0430\u0433\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a\u00a0<code>.yaml<\/code>\u0438\u043b\u0438\u00a0<code>.png<\/code>.\u00a0<a href=\"https:\/\/bun.sh\/docs\/runtime\/plugins\" rel=\"noopener noreferrer nofollow\">API\u00a0\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/a>\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 esbuild, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 esbuild \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 Bun \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438:<\/p>\n<pre><code class=\"javascript\">import { plugin } from \"bun\";  plugin({   name: \"YAML\",   async setup(build) {     const { load } = await import(\"js-yaml\");     const { readFileSync } = await import(\"fs\");     build.onLoad({ filter: \/.(yaml|yml)$\/ }, (args) => {       const text = readFileSync(args.path, \"utf8\");       const exports = load(text) as Record&lt;string, any>;       return { exports, loader: \"object\" };     });   }, }); <\/code><\/pre>\n<h3>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 APIs<\/h3>\n<p>Bun \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 API Node.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u044d\u0442\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 <em>Bun APIs<\/em>\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p><strong>Bun.file()<\/strong><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>Bun.file()<\/code>\u0434\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u00a0\u0444\u0430\u0439\u043b\u0430  \u043f\u0443\u0442\u0438.<\/p>\n<pre><code class=\"javascript\">const file = Bun.file(\"package.json\"); const contents = await file.text();<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>BunFile<\/code>, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0431-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u00a0<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/File\" rel=\"noopener noreferrer nofollow\">File<\/a>.\u00a0\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445.<\/p>\n<pre><code class=\"javascript\">const file = Bun.file(\"package.json\"); await file.text(); \/\/ string await file.arrayBuffer(); \/\/ ArrayBuffer await file.blob(); \/\/ Blob await file.json(); \/\/ {...}<\/code><\/pre>\n<blockquote>\n<p>Bun \u0447\u0438\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 10 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1513878964531519494\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p><strong>Bun.write()<\/strong><\/p>\n<p><code>Bun.write()<\/code>\u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0433\u0438\u0431\u043a\u0438\u0439 API \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u2014 \u0441\u0442\u0440\u043e\u043a, \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u043b\u043e\u0431\u043e\u0432 \u0438 \u0434\u0430\u0436\u0435\u00a0<code>Response<\/code>\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">await Bun.write(\"index.html\", \"&lt;html\/>\"); await Bun.write(\"index.html\", Buffer.from(\"&lt;html\/>\")); await Bun.write(\"index.html\", Bun.file(\"home.html\")); await Bun.write(\"index.html\", await fetch(\"&lt;https:\/\/example.com\/>\"));<\/code><\/pre>\n<blockquote>\n<p>Bun \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 3 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1551003252920946688\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p><strong>Bun.serve()<\/strong><\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>Bun.serve()<\/code> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, WebSocket-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u043b\u0438 \u043e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\u00a0\u041e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 Web-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 API, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a\u00a0<code>Request<\/code>\u0438\u00a0<code>Response<\/code>.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   port: 3000,   fetch(request) {     return new Response(\"Hello from Bun!\");   }, });<\/code><\/pre>\n<blockquote>\n<p>Bun \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0432 4 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/github.com\/oven-sh\/bun\/tree\/main\/bench\/react-hello-world\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u043e\u043b\u044c\u0448\u0435<\/strong><\/a>\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c TLS, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443\u00a0<code>tls<\/code>\u043e\u043f\u0446\u0438\u044e.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   port: 3000,   fetch(request) {     return new Response(\"Hello from Bun!\");   },   tls: {     key: Bun.file(\"\/path\/to\/key.pem\"),     cert: Bun.file(\"\/path\/to\/cert.pem\"),   } });<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WebSockets \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 HTTP \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u00a0<code>websocket<\/code>.\u00a0\u0412 Node.js \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>ws<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WebSocket \u043d\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   fetch() { \/* ... *\/ },   websocket: {     open(ws) { \/* ... *\/  },     message(ws, data) { ... },     close(ws, code, reason) { ... },   }, });<\/code><\/pre>\n<blockquote>\n<p>Bun \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 5 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/github.com\/oven-sh\/bun\/tree\/main\/bench\/websocket-server\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u043e\u043b\u044c\u0448\u0435<\/strong><\/a>\u00a0\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0435\u043c\u00a0<code>ws<\/code>Node.js.<\/p>\n<\/blockquote>\n<p><strong>bun:sqlite<\/strong><\/p>\n<p>Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <code>SQLite<\/code>. API \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043e <code>better-sqlite3<\/code>, \u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<pre><code class=\"javascript\">import { Database } from \"bun:sqlite\"; const db = new Database(\":memory:\"); const query = db.query(\"select 'Bun' as runtime;\"); query.get(); \/\/ => { runtime: \"Bun\" }<\/code><\/pre>\n<blockquote>\n<p>\u0411\u0430\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a SQLite \u0434\u043e 4 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/github.com\/oven-sh\/bun\/tree\/main\/bench\/sqlite\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c\u00a0<code>better-sqlite3<\/code> \u0432 Node.js.<\/p>\n<\/blockquote>\n<p><strong>Bun.password<\/strong><\/p>\n<p>Bun \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 API \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445, \u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<code>Bun.password<\/code>\u0434\u043b\u044f \u0445\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>bcrypt<\/code> \u0438\u043b\u0438 <code>argon2<\/code>, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"javascript\">const password = \"super-secure-pa$$word\"; const hash = await Bun.password.hash(password); \/\/ => $argon2id$v=19$m=65536,t=2,p=1$tFq+9AVr1bfPxQdh... const isMatch = await Bun.password.verify(password, hash); \/\/ => true<\/code><\/pre>\n<h3>Bun \u2014 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/h3>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Bun \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 Bun \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u00a0\u041f\u0440\u043e\u0448\u043b\u0438 \u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u0434\u043e\u043b\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430  \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 <code>npm<\/code>.<\/p>\n<p>\u0425\u043e\u0442\u044f Bun <em>\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/em>\u00a0\u043a\u0430\u043a \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 \u0432\u0430\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<pre><code class=\"bash\">bun install bun add &lt;package> [--dev|--production|--peer] bun remove &lt;package> bun update &lt;package><\/code><\/pre>\n<p>Bun <em>\u043e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f<\/em> \u0438\u043d\u0430\u0447\u0435!<\/p>\n<p><strong>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438<\/strong><\/p>\n<p>Bun \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c\u00a0<code>npm<\/code>,\u00a0<code>yarn<\/code>, \u0438\u00a0<code>pnpm<\/code>.\u00a0\u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0435\u0448 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u0438\u0437 \u0440\u0435\u0435\u0441\u0442\u0440\u0430 npm, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0430\u043c\u044b\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/abd\/bfe\/988\/abdbfe988a92daa582a0d94c47876478.png\" alt=\"\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Remix.\" title=\"\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Remix.\" width=\"2680\" height=\"1324\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abd\/bfe\/988\/abdbfe988a92daa582a0d94c47876478.png\"\/><\/p>\n<div><figcaption>\u0411\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Remix.<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/strong><\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0434\u0430\u0432\u043d\u043e\u00a0\u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 <code>node<\/code>.\u00a0\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c  \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c\u0438 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"bash\">npm run dev<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c\u00a0<code>npm run<\/code>\u043d\u0430 <code>bun run<\/code>, \u0447\u0442\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 150 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u00a0<em>\u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c<\/em>\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u042d\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 CLI \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u0430.\u00a0\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c2c\/191\/4fa\/c2c1914fa8516dd2211c8af41323a1d8.gif\" alt=\"npm run \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043b\u0430\u0433\u0430\u0435\u0442\" title=\"npm run \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043b\u0430\u0433\u0430\u0435\u0442\" width=\"1464\" height=\"1050\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c2c\/191\/4fa\/c2c1914fa8516dd2211c8af41323a1d8.gif\"\/><\/p>\n<div><figcaption>npm run \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043b\u0430\u0433\u0430\u0435\u0442<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cbd\/e0c\/1ba\/cbde0c1ba4c6e0ea6207e0d6589eee27.gif\" alt=\"bun run \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\" title=\"bun run \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\" width=\"1464\" height=\"1050\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cbd\/e0c\/1ba\/cbde0c1ba4c6e0ea6207e0d6589eee27.gif\"\/><\/p>\n<div><figcaption>bun run \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0434\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043a npm.\u00a0<code>bun run &lt;command><\/code>\u00a0<a href=\"https:\/\/gist.github.com\/colinhacks\/436b6836cd13291a79dd50dcde2d45bf\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0\u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u00a0<code>yarn<\/code>, \u0438 \u0432\u00a0<code>pnpm<\/code>.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430<\/p>\n<\/th>\n<th>\n<p>\u0421\u0440\u0435\u0434\u043d\u0435\u0435\u00a0\u0432\u0440\u0435\u043c\u044f<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">npm run<\/p>\n<\/td>\n<td>\n<p align=\"left\">176ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">yarn run<\/p>\n<\/td>\n<td>\n<p align=\"left\">131ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">pnpm run<\/p>\n<\/td>\n<td>\n<p align=\"left\">259ms<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">bun run<\/p>\n<\/td>\n<td>\n<p align=\"left\">7ms?<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>Bun &#8212; \u0442\u0435\u0441\u0442 \u0440\u0430\u043d\u043d\u0435\u0440<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 JavaScript, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 Jest, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u043b \u043f\u0438\u043e\u043d\u0435\u0440\u043e\u043c API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 \u0441\u0442\u0438\u043b\u0435 \u00abexpect\u00bb. (<em>\u041a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0431\u044b\u043b\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0438\u043e\u043d\u0435\u0440\u044b, \u043a\u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b expect-\u0441\u0442\u0438\u043b\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/em>)<\/p>\n<p>Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00a0<code>bun:test<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0441 Jest.<\/p>\n<pre><code class=\"javascript\">import { test, expect } from \"bun:test\";  test(\"2 + 2\", () => {   expect(2 + 2).toBe(4); });<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>bun test<\/code>\u043a\u043e\u043c\u0430\u043d\u0434\u044b.  \u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Bun, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 TypeScript \u0438 JSX.<\/p>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Jest \u0438\u043b\u0438 Vitest \u043f\u0440\u043e\u0441\u0442\u0430.\u00a0\u041b\u044e\u0431\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u0437\u00a0<code>@jest\/globals<\/code>\u0438\u043b\u0438\u00a0<code>vitest<\/code>\u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u0437 <code>bun:test<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"javascript\">\/\/ index.test.ts import { test } from \"@jest\/globals\";  describe(\"test suite\", () => {   \/\/ ... });<\/code><\/pre>\n<p>\u0412 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0435 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 <a href=\"https:\/\/github.com\/colinhacks\/zod\" rel=\"noopener noreferrer nofollow\">zod<\/a> Bun \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 13 \u0440\u0430\u0437, \u0447\u0435\u043c Jest, \u0438 \u0432 8 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Vitest.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/698\/903\/484\/6989034843c1d8222b0d49ec99c25bc4.png\" width=\"1487\" height=\"848\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/698\/903\/484\/6989034843c1d8222b0d49ec99c25bc4.png\"\/><\/figure>\n<p>\u041c\u0430\u0442\u0447\u0435\u0440\u044b Bun \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443\u00a0<code>expect().toEqual()<\/code> \u0432 Bun \u0432 100 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1595681235606585346\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Jest, \u0438 \u0432 10 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Vitest.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 CI \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>bun test<\/code>.\u00a0\u0412 Github Actions \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>oven-sh\/setup-bun<\/code>.<\/p>\n<pre><code class=\"yaml\"># .github\/workdlows\/ci.yml  name: CI on: [push, pull_request]  jobs:   test:     runs-on: ubuntu-latest     steps:       - uses: actions\/checkout@v2       - uses: oven-sh\/setup-bun@v1       - run: bun test<\/code><\/pre>\n<p>\u0410 \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0435\u0449\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435, Bun \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043a \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043b\u043e\u0433\u0438 CI \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u0447\u0438\u0442\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a22\/41f\/a3b\/a2241fa3b857aff86b0d46216d8dbf2c.jpeg\" width=\"1234\" height=\"792\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a22\/41f\/a3b\/a2241fa3b857aff86b0d46216d8dbf2c.jpeg\" data-blurred=\"true\"\/><\/figure>\n<h3>Bun \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430<\/h3>\n<p>Bun \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 JavaScript \u0438 TypeScript \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, Node.js \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<pre><code class=\"bash\">bun build .\/index.tsx --outdir .\/build <\/code><\/pre>\n<p>\u041e\u043d \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u00a0<a href=\"https:\/\/esbuild.github.io\/api\/\" rel=\"noopener noreferrer nofollow\"><strong>esbuild<\/strong><\/a>\u00a0\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 API \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">import mdx from \"@mdx-js\/esbuild\";  Bun.build({   entrypoints: [\"index.tsx\"],   outdir: \"build\",   plugins: [mdx()], }); <\/code><\/pre>\n<p>\u0412 Bun API \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c, \u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430,\u00a0<em>\u0442\u0430\u043a \u0438<\/em>\u00a0\u0434\u043b\u044f \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.\u00a0\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u00a0<code>.yaml<\/code>, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0448\u043b\u0430 \u0440\u0435\u0447\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430\u00a0<code>.yaml<\/code> \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c esbuild, Bun \u0432 1,75 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c esbuild, \u0432 150 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Parcel 2, \u0432 180 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Rollup + Terser, \u0438 \u0432 220 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Webpack.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/92a\/4fc\/44e\/92a4fc44e908d0b1f31c53d2df71b313.png\" alt=\"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 10 \u043a\u043e\u043f\u0438\u0439 Three.js \u0441 \u043d\u0443\u043b\u044f, \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439\" title=\"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 10 \u043a\u043e\u043f\u0438\u0439 Three.js \u0441 \u043d\u0443\u043b\u044f, \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439\" width=\"2690\" height=\"1072\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/92a\/4fc\/44e\/92a4fc44e908d0b1f31c53d2df71b313.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 10 \u043a\u043e\u043f\u0438\u0439 Three.js \u0441 \u043d\u0443\u043b\u044f, \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043a\u0430\u0440\u0442\u0430\u043c\u0438 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<p>C\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a Bun \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e Bun \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0431\u043e\u0440\u0449\u0438\u043a.<\/p>\n<p>\u0411\u0430\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b JavaScript \u2014 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 JavaScript \u0432\u043e \u0432\u0440\u0435\u043c\u044f\u00a0<em>\u0441\u0431\u043e\u0440\u043a\u0438<\/em>\u00a0.\u00a0\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u044d\u0442\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0430\u0448 \u043f\u0430\u043a\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">\/\/ index.ts import { getRelease } from \".\/release.ts\" with { type: \"macro\" }; \/\/ The value of release is evaluated at bundle-time, \/\/ and inlined into the bundle, not run-time. const release = await getRelease(); <\/code><\/pre>\n<pre><code class=\"javascript\">\/\/ release.ts export async function getRelease(): Promise&lt;string> {   const response = await fetch(     \"&lt;https:\/\/api.github.com\/repos\/oven-sh\/bun\/releases\/latest>\"   );   const { tag_name } = await response.json();   return tag_name; } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 <code>bun build index.ts<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"javascript\">var release = await \"bun-v1.0.0\"<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043d\u043e\u0432\u0430\u044f \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f JavaScript, \u0438 \u043c\u044b \u0441 \u043d\u0435\u0442\u0435\u0440\u043f\u0435\u043d\u0438\u0435\u043c \u0436\u0434\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u0442\u0435.<\/p>\n<h3>\u041a\u043e\u0435-\u0447\u0442\u043e \u0435\u0449\u0435\u2026<\/h3>\n<p>Bun \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f macOS \u0438 Linux, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435: Windows.\u00a0\u0420\u0430\u043d\u044c\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Bun \u0432 Windows, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 Windows \u0434\u043b\u044f Linux&#8230; \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>\u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u043c\u044b \u0440\u0430\u0434\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e  \u0441\u0431\u043e\u0440\u043a\u0443 Bun \u0434\u043b\u044f Windows.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0c8\/656\/501\/0c865650183975d79eafcb72d597b30f.png\" width=\"1604\" height=\"804\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c8\/656\/501\/0c865650183975d79eafcb72d597b30f.png\"\/><\/figure>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u0431\u043e\u0440\u043a\u0438 Bun \u0434\u043b\u044f macOS \u0438 Linux \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d,\u00a0<strong>\u0441\u0431\u043e\u0440\u043a\u0430 \u0434\u043b\u044f Windows \u043d\u043e\u0441\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440<\/strong>\u00a0.\u00a0\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript;\u00a0\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u043d\u0435 \u0441\u0442\u0430\u043d\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0431\u044b\u043b\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 (\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0430).<\/p>\n<p>\u0412 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Windows.\u00a0\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f Bun \u0434\u043b\u044f Windows, \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0432\u0430\u043c \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u00a0<code>#windows<\/code>\u043a\u0430\u043d\u0430\u043b\u0443 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c\u00a0<a href=\"https:\/\/bun.sh\/discord\" rel=\"noopener noreferrer nofollow\"><strong>Discord<\/strong><\/a>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u0421\u043f\u0430\u0441\u0438\u0431\u043e<\/h3>\n<p>\u041f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435 \u043a \u0432\u0435\u0440\u0441\u0438\u0438 1.0 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0431\u0435\u0437 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0442\u0435\u0445, \u043a\u0442\u043e \u043f\u043e\u043c\u043e\u0433 \u043d\u0430\u043c \u0434\u043e\u0439\u0434\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>Node.js \u0438 \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0435\u0440\u044b. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043d\u0430 \u043f\u043b\u0435\u0447\u0430\u0445 \u0433\u0438\u0433\u0430\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>WebKit \u0438 \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0435\u0440\u044b, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u00a0<a href=\"https:\/\/twitter.com\/Constellation\" rel=\"noopener noreferrer nofollow\"><strong>Constellation<\/strong><\/a><strong>.<\/strong> \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0435 WebKit \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0412\u044b \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/oven-sh\/bun\/graphs\/contributors\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0447\u0442\u0438\u00a0300 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c Bun \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0433\u043e\u0434\u0430!<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h3>\n<p>Bun 1.0 \u2014 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f JavaScript \u0438 TypeScript \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d.\u00a0\u0418 \u043c\u044b\u00a0<a href=\"https:\/\/bun.sh\/careers\" rel=\"noopener noreferrer nofollow\"><strong>\u043d\u0430\u043d\u0438\u043c\u0430\u0435\u043c<\/strong><\/a>\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0443\u0434\u0443\u0449\u0435\u0435 JavaScript.<\/p>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/bun.sh\/discord\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u0441\u044f<\/a> \u043a \u043d\u0430\u0448\u0435\u043c\u0443 Discord, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e Bun<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/twitter.com\/bunjavascript\" rel=\"noopener noreferrer nofollow\">\u0421\u043b\u0435\u0434\u0438\u0442\u044c<\/a> \u0437\u0430 \u043d\u0430\u043c\u0438 \u0432 X\/Twitter, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043c\u0435\u043c\u044b \u043e JavaScript \u0438 \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e\u0442 \u0414\u0436\u0430\u0440\u0435\u0434\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/oven-sh\/bun\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u043c \u0437\u0432\u0435\u0437\u0434\u0443<\/a> \u043d\u0430 Github \u2014 \u044d\u0442\u043e \u043e\u043a\u0443\u043f\u0438\u0442 \u0440\u0430\u0441\u0445\u043e\u0434\u044b!\u00a0(\/\u0441\u0430\u0440\u043a\u0430\u0437\u043c)<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0416\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 0.8<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 Bun\u00a0<em>\u0414\u041e<\/em>\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 1.0, \u0442\u043e \u0432\u043e\u0442 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c.<\/p>\n<ul>\n<li>\n<p>Next.js, Astro \u0438 Nest.js \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f!<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u00a0<code>bun dev<\/code>  \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430. \u0422\u0435\u043f\u0435\u0440\u044c  <code>bun dev<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0432\u0430\u0448\u0435\u043c package.json<\/p>\n<\/li>\n<\/ul>\n<p>Bun \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 Node.js APIs:<\/p>\n<ul>\n<li>\n<p><code>child_process.fork()<\/code> \u0438 IPC<\/p>\n<\/li>\n<li>\n<p><code>fs.cp()<\/code> \u0438 <code>fs.cpSync()<\/code><\/p>\n<\/li>\n<li>\n<p><code>fs.watchFile()<\/code> \u0438 <code>fs.unwatchFile()<\/code><\/p>\n<\/li>\n<li>\n<p>Unix-\u0441\u043e\u043a\u0435\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435\u00a0<code>node:http<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u043e\u0440\u044f\u0447\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u00a0<code>Bun.serve()<\/code>.\u00a0\u0420\u0430\u043d\u044c\u0448\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u044b\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0447\u0435\u0440\u0435\u0437\u00a0<code>default export<\/code>.  \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a <code>bun --hot server.ts<\/code>:<\/p>\n<pre><code class=\"javascript\">\/\/ server.ts Bun.serve({   fetch(request) {     return new Response(\"Reload!\");   }, })<\/code><\/pre>\n<hr\/>\n<p>P.S. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u043f\u043e\u0448\u0435\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>bun run<\/code> \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u0435\u0441\u0442\u044c <code>eslint<\/code>, <code>typescript<\/code>, <code>cspell<\/code>, <code>prettier<\/code>, <code>jest<\/code> &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435  \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e, \u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u044b (\u0434\u043e 50%), \u0430 \u043d\u0435 \u0440\u0430\u0437\u044b. \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 <code>burn test<\/code> &#8212; \u0443\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 jest \/ ts \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u0432\u0441\u044f\u043a\u0438\u0445 modulePaths, baseUrl, paths \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041f\u0440\u043e \u0437\u0430\u043c\u0435\u043d\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0438 Docker-\u043e\u0432 \u043f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0433\u0443, \u043d\u043e \u0442\u0443\u0442 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0441\u043a\u0430\u0436\u0443\u0442 \u0432\u0441\u0435 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f, \u043a\u043e\u0433\u0434\u0430 \u0440\u0443\u043a\u0438 \u0434\u043e\u0439\u0434\u0443\u0442.<\/p>\n<p>\u0412\u0435\u0434\u0443 \u043a\u0430\u043d\u0430\u043b <a href=\"https:\/\/t.me\/alexcatcode\" rel=\"noopener noreferrer nofollow\">Alex Code<\/a> \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435\u00a0\u043f\u0440\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \ud83d\ude09<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/760002\/\"> https:\/\/habr.com\/ru\/articles\/760002\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c Bun \u0432\u0435\u0440\u0441\u0438\u0438 1.0.<\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 JavaScript \u0438 TypeScript \u043a\u043e\u0434\u0430 (\u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043e fullstack-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f).\u00a0\u0421\u0435\u0433\u043e\u0434\u043d\u044f Bun \u0441\u0442\u0430\u0431\u0438\u043b\u0435\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0443.<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Bun<\/strong><\/p>\n<pre><code class=\"bash\"># curl curl -fsSL https:\/\/bun.sh\/install | bash # npm npm install -g bun # brew brew tap oven-sh\/bun brew install bun # docker docker pull oven\/bun docker run --rm --init --ulimit memlock=-1:-1 oven\/bun<\/code><\/pre>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Bun<\/strong><\/p>\n<pre><code class=\"bash\">bun upgrade<\/code><\/pre>\n<h3>Bun \u2014 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h3>\n<p>\u041c\u044b \u043b\u044e\u0431\u0438\u043c JavaScript.\u00a0\u041e\u043d \u0437\u0440\u0435\u043b\u044b\u0439, \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438 \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e.\u00a0\u042d\u0442\u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0435.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f Node.js \u043f\u0440\u043e\u0448\u043b\u043e 14 \u043b\u0435\u0442. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0433\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b  \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u043e\u0439 \u0437\u0430 \u0441\u043b\u043e\u0435\u043c.\u00a0\u0418 \u043a\u0430\u043a \u043b\u044e\u0431\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u0442\u0435\u0442 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b JavaScript \u0441\u0442\u0430\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438.<\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 Bun \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442?<\/strong><\/p>\n<p>\u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430 &#8212; \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c,\u00a0<em>\u041d\u0415<\/em>\u00a0\u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u044f\u0441\u044c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0432 JavaScript.\u00a0\u0412\u0430\u0448\u0438 \u043b\u044e\u0431\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443. \u0412\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043a.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0430\u043c\u00a0<em>\u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f<\/em>\u00a0\u043f\u043e\u0437\u0430\u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0411\u0430\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c\u0438:<\/p>\n<p><strong>Node.js.<\/strong> Bun \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 Node.js, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><code>node<\/code><\/p>\n<\/li>\n<li>\n<p><code>npx<\/code> &#8212; bunx \u0432 5 \u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/p>\n<\/li>\n<li>\n<p><code>nodemon<\/code> \u2014 Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 watch-\u0440\u0435\u0436\u0438\u043c<\/p>\n<\/li>\n<li>\n<p><code>dotenv<\/code>, <code>cross-env<\/code> &#8212; Bun \u0447\u0438\u0442\u0430\u0435\u0442 <code>.env<\/code> \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0422\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b.<\/strong> Bun \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u00a0<code>.js<\/code>,\u00a0<code>.ts<\/code>,\u00a0<code>.cjs<\/code>,\u00a0<code>.mjs<\/code>,\u00a0<code>.jsx<\/code>\u0438\u00a0<code>.tsx<\/code>\u0444\u0430\u0439\u043b\u044b, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0441\u043e\u0431\u043e\u0439:<\/p>\n<ul>\n<li>\n<p><code>tsc<\/code> \u2014 (\u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432!)<\/p>\n<\/li>\n<li>\n<p><code>babel<\/code>, <code>.babelrc<\/code>, <code>@babel\/preset-*<\/code><\/p>\n<\/li>\n<li>\n<p><code>ts-node<\/code>, <code>ts-node-esm<\/code><\/p>\n<\/li>\n<li>\n<p><code>tsx<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0430\u043d\u0434\u043b\u0435\u0440\u044b. Bun \u2014 \u044d\u0442\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a JavaScript \u0441 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441 esbuild API \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<ul>\n<li>\n<p><code>esbuild<\/code><\/p>\n<\/li>\n<li>\n<p><code>webpack<\/code><\/p>\n<\/li>\n<li>\n<p><code>parcel<\/code>, <code>.parcelrc<\/code><\/p>\n<\/li>\n<li>\n<p><code>rollup<\/code>, <code>rollup.config.js<\/code><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/strong>\u00a0. Bun \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f npm-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438.\u00a0\u041e\u043d \u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0430\u0448 \u0444\u0430\u0439\u043b\u00a0<code>package.json<\/code>\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0<code>node_modules<\/code>, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>npm<\/code>, <code>.npmrc<\/code>, <code>package-lock.json<\/code><\/p>\n<\/li>\n<li>\n<p><code>yarn<\/code>, <code>yarn.lock<\/code><\/p>\n<\/li>\n<li>\n<p><code>pnpm<\/code>, <code>pnpm.lock<\/code>, <code>pnpm-workspace.yaml<\/code><\/p>\n<\/li>\n<li>\n<p><code>lerna<\/code><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/strong> Bun \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Jest-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0442\u0435\u0441\u0442-\u0440\u0430\u043d\u043d\u0435\u0440\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u043c\u043e\u043a\u043e\u0432 \u0438 code coverage, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b:<\/p>\n<ul>\n<li>\n<p><code>jest<\/code>, <code>jest.config.js<\/code><\/p>\n<\/li>\n<li>\n<p><code>ts-jest<\/code>, <code>@swc\/jest<\/code>, <code>babel-jest<\/code><\/p>\n<\/li>\n<li>\n<p><code>jest-extended<\/code><\/p>\n<\/li>\n<li>\n<p><code>vitest<\/code>, <code>vitest.config.ts<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0442\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0445\u043e\u0440\u043e\u0448 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 (\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c), \u0438\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u00a0\u041e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b;\u00a0\u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435\u00a0<code>jest<\/code>\u0432\u0430\u0448 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u0440\u0448\u0435\u043d \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 3 \u0440\u0430\u0437!\u00a0\u0410 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b (\u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0437\u043e\u043b\u0435\u043d\u0442\u0430 \u0441\u043e \u0441\u043a\u043e\u0442\u0447\u0435\u043c ?), \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u0437\u043d\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.\u00a0\u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0438\u0435 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 API.<\/p>\n<h3>Bun \u2014 \u044d\u0442\u043e \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript.<\/h3>\n<p>Bun \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript.\u00a0\u0415\u0433\u043e \u0446\u0435\u043b\u044c \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043c\u0435\u043d\u0435\u0435 \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p><strong>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Node.js<\/strong><\/p>\n<p>Bun \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 Node.js.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Node.js \u0438 \u043f\u0430\u043a\u0435\u0442\u044b npm\u00a0<em>\u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442<\/em>\u00a0\u0432 Bun.\u00a0Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Node.js APIs, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0<code>fs<\/code>, <code>path<\/code> \u0438 <code>net<\/code><\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0<code>__dirname<\/code> \u0438 <code>process<\/code><\/p>\n<\/li>\n<li>\n<p>\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 <code>node_modules<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0425\u043e\u0442\u044f\u00a0<em>\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f<\/em>\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 Node.js \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 (\u0438\u0437-\u0437\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<code>node:v8<\/code>&#8212; <a href=\"https:\/\/nodejs.org\/docs\/latest-v20.x\/api\/v8.html\" rel=\"noopener noreferrer nofollow\">https:\/\/nodejs.org\/docs\/latest-v20.x\/api\/v8.html<\/a>), Bun \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Node.js.<\/p>\n<p>Bun \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 Node.js \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 npm.\u00a0\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Express, Koa \u0438 Hono, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.\u00a0\u041a\u0430\u043a \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0443\u043b\u0441\u0442\u0435\u043a \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.\u00a0\u0412 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438  Node.js API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"bordered full-width\">\n<div><figcaption>\u041f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Next.js, Remix, Nuxt, Astro, SvelteKit, Nest, SolidStart \u0438 Vite, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 Bun.<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/strong><\/p>\n<p>Bun \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 4 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1499225725492076544\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.\u00a0\u042d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 TypeScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c Node.js \u0441\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<figure class=\"bordered full-width\">\n<div><figcaption>\u0411\u0430\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 &#171;Hello, wolrd!&#187; \u043d\u0430 TypeScript \u0432 5 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c Node.js \u0441 esbul.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Node.js \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0432\u0438\u0436\u043a\u0430 V8 \u043e\u0442 Google, Bun \u0441\u043e\u0437\u0434\u0430\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c\u00a0\u0434\u0432\u0438\u0436\u043a\u0430 <a href=\"https:\/\/webkit.org\/\" rel=\"noopener noreferrer nofollow\">WebKit<\/a> (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 Apple). WebKit \u2014 \u044d\u0442\u043e \u0434\u0432\u0438\u0436\u043e\u043a, \u043b\u0435\u0436\u0430\u0449\u0438\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 Safari \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.\u00a0\u041e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u044f\u043c\u0438.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430. <\/em>\u0421\u0442\u043e\u0438\u0442 \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e bun \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043c\u043e\u043b\u043e\u0434\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/ziglang.org\/\" rel=\"noopener noreferrer nofollow\">Zig<\/a> (\u0435\u0449\u0435 \u0441\u0430\u043c \u043d\u0435 \u0434\u043e\u0448\u0435\u043b \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 1.0). Zig \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0442\u0443\u0436\u0435 \u043d\u0438\u0448\u0443 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0438 C\/C++ \u0438 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u043f\u043e\u0440 Rust.<\/p>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 TypeScript \u0438 JSX<\/strong><\/p>\n<p>\u0412 Bun \u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b JavaScript, TypeScript \u0438 \u0434\u0430\u0436\u0435 JSX\/TSX \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code class=\"bash\">bun index.t # or bun index.tsx<\/code><\/pre>\n<p><strong>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c ESM \u0438 CommonJS<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 <code>CommonJS<\/code> \u043a  <code>ES<\/code>-\u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0431\u044b\u043b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u0442\u044f\u0436\u0435\u043b\u044b\u043c.\u00a0\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f ESM Node.js \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c 5 \u043b\u0435\u0442 \u0434\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u0435\u0437\u00a0<code>--experimental-modules<\/code>\u0444\u043b\u0430\u0433\u0430.\u00a0\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043e\u043b\u043d\u0430 <code>CommonJS<\/code>.<\/p>\n<p>Bun \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\u00a0\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (<code>.js<\/code>,\u00a0<code>.cjs<\/code>, <code>.mjs<\/code>), \u0438\u043b\u0438 \u043e <code>\"type\": \"module\"<\/code> \u0432 <code>package.json<\/code>.<\/p>\n<p>\u0412\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<code>import<\/code>\u0438\u00a0<code>require()<\/code>\u0432\u00a0<em>\u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u0436\u0435 \u0444\u0430\u0439\u043b\u0435.<\/em>\u00a0\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">import lodash from \"lodash\"; const _ = require(\"underscore\")<\/code><\/pre>\n<p><strong>\u0412\u0435\u0431-API<\/strong><\/p>\n<p>Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Web APIs, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0443\u0442\u0443\u043f\u043d\u044b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 (<code>fetch<\/code>,\u00a0<code>Request<\/code>,\u00a0<code>Response<\/code>,\u00a0<code>WebSocket<\/code>\u0438\u00a0<code>ReadableStream<\/code>).<\/p>\n<pre><code class=\"javascript\">const response = await fetch(\"&lt;https:\/\/example.com\/>\"); const text = await response.text()<\/code><\/pre>\n<p>\u0412\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u043a\u0430\u043a\u00a0<code>node-fetch<\/code>\u0438\u00a0<code>ws<\/code>.\u00a0\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 Web APIs  \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 Bun \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.<\/p>\n<p><strong>Hot reloading<\/strong><\/p>\n<p>Bun \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.\u00a0\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Bun \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\u00a0<code>--hot<\/code>, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 hot reloading, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<pre><code class=\"bash\">bun --hot server.ts<\/code><\/pre>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>nodemon<\/code>, Bun \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434, \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f \u0441\u0442\u0430\u0440\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\u00a0\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f HTTP \u0438 WebSocket \u043d\u0435 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0413\u0438\u0444\u043a\u0430 \u043f\u0440\u043e hot reloading \u043b\u0435\u0436\u0438\u0442 \u0442\u0443\u0442 &#8212; <a href=\"https:\/\/bun.sh\/hot.gif\" rel=\"noopener noreferrer nofollow\">https:\/\/bun.sh\/hot.gif<\/a><\/p>\n<p><strong>\u041f\u043b\u0430\u0433\u0438\u043d\u044b<\/strong><\/p>\n<p>Bun \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.\u00a0\u041f\u043b\u0430\u0433\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a\u00a0<code>.yaml<\/code>\u0438\u043b\u0438\u00a0<code>.png<\/code>.\u00a0<a href=\"https:\/\/bun.sh\/docs\/runtime\/plugins\" rel=\"noopener noreferrer nofollow\">API\u00a0\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/a>\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 esbuild, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 esbuild \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 Bun \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438:<\/p>\n<pre><code class=\"javascript\">import { plugin } from \"bun\";  plugin({   name: \"YAML\",   async setup(build) {     const { load } = await import(\"js-yaml\");     const { readFileSync } = await import(\"fs\");     build.onLoad({ filter: \/.(yaml|yml)$\/ }, (args) => {       const text = readFileSync(args.path, \"utf8\");       const exports = load(text) as Record&lt;string, any>;       return { exports, loader: \"object\" };     });   }, }); <\/code><\/pre>\n<h3>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 APIs<\/h3>\n<p>Bun \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 API Node.js, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438, \u044d\u0442\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 <em>Bun APIs<\/em>\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p><strong>Bun.file()<\/strong><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u00a0<code>Bun.file()<\/code>\u0434\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u00a0\u0444\u0430\u0439\u043b\u0430  \u043f\u0443\u0442\u0438.<\/p>\n<pre><code class=\"javascript\">const file = Bun.file(\"package.json\"); const contents = await file.text();<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>BunFile<\/code>, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0431-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u00a0<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/File\" rel=\"noopener noreferrer nofollow\">File<\/a>.\u00a0\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445.<\/p>\n<pre><code class=\"javascript\">const file = Bun.file(\"package.json\"); await file.text(); \/\/ string await file.arrayBuffer(); \/\/ ArrayBuffer await file.blob(); \/\/ Blob await file.json(); \/\/ {...}<\/code><\/pre>\n<blockquote>\n<p>Bun \u0447\u0438\u0442\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 10 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1513878964531519494\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p><strong>Bun.write()<\/strong><\/p>\n<p><code>Bun.write()<\/code>\u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0433\u0438\u0431\u043a\u0438\u0439 API \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0434\u0438\u0441\u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u2014 \u0441\u0442\u0440\u043e\u043a, \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u043b\u043e\u0431\u043e\u0432 \u0438 \u0434\u0430\u0436\u0435\u00a0<code>Response<\/code>\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">await Bun.write(\"index.html\", \"&lt;html\/>\"); await Bun.write(\"index.html\", Buffer.from(\"&lt;html\/>\")); await Bun.write(\"index.html\", Bun.file(\"home.html\")); await Bun.write(\"index.html\", await fetch(\"&lt;https:\/\/example.com\/>\"));<\/code><\/pre>\n<blockquote>\n<p>Bun \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0432 3 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/twitter.com\/jarredsumner\/status\/1551003252920946688\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u044b\u0441\u0442\u0440\u0435\u0435<\/strong><\/a>\u00a0, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p><strong>Bun.serve()<\/strong><\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>Bun.serve()<\/code> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, WebSocket-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u043b\u0438 \u043e\u0431\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\u00a0\u041e\u043d \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 Web-\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 API, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a\u00a0<code>Request<\/code>\u0438\u00a0<code>Response<\/code>.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   port: 3000,   fetch(request) {     return new Response(\"Hello from Bun!\");   }, });<\/code><\/pre>\n<blockquote>\n<p>Bun \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0432 4 \u0440\u0430\u0437\u0430\u00a0<a href=\"https:\/\/github.com\/oven-sh\/bun\/tree\/main\/bench\/react-hello-world\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u043e\u043b\u044c\u0448\u0435<\/strong><\/a>\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0435\u043c Node.js.<\/p>\n<\/blockquote>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c TLS, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443\u00a0<code>tls<\/code>\u043e\u043f\u0446\u0438\u044e.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   port: 3000,   fetch(request) {     return new Response(\"Hello from Bun!\");   },   tls: {     key: Bun.file(\"\/path\/to\/key.pem\"),     cert: Bun.file(\"\/path\/to\/cert.pem\"),   } });<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WebSockets \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 HTTP \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u00a0<code>websocket<\/code>.\u00a0\u0412 Node.js \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>ws<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 WebSocket \u043d\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">Bun.serve({   fetch() { \/* ... *\/ },   websocket: {     open(ws) { \/* ... *\/  },     message(ws, data) { ... },     close(ws, code, reason) { ... },   }, });<\/code><\/pre>\n<blockquote>\n<p>Bun \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 5 \u0440\u0430\u0437\u00a0<a href=\"https:\/\/github.com\/oven-sh\/bun\/tree\/main\/bench\/websocket-server\" rel=\"noopener noreferrer nofollow\"><strong>\u0431\u043e\u043b\u044c\u0448\u0435<\/strong><\/a>\u00a0\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0435\u043c\u00a0<code>ws<\/code>Node.js.<\/p>\n<\/blockquote>\n<p><strong>bun:sqlite<\/strong><\/p>\n<p>Bun \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <code>SQLite<\/code>. API \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043e <code>better-sqlite3<\/code>, \u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<pre><code class=\"javascript\">import { Database } from \"bun:sqlite\"; const db = new Database(\":memory:\"); const query = db.query(\"select 'Bun' as runtime;\"); query.get(); \/\/ => { runtime: \"Bun\" }<\/code><\/pre>\n<blockquote>\n<p>\u0411\u0430\u043d<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-354436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}