
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
Раздача статики и провайдеры рантайма для [`h11`](../h11): подключает `H11`-инстанс к `Bun.serve` или `node:http`, и умеет отдавать файлы с диска.
Раздача статики и провайдеры рантайма для h11: подключает H11-инстанс к Bun.serve или node:http, и умеет отдавать файлы с диска.
Три точки входа:
h11-fs — раздача статики, runtime-независимый fsApi.h11-fs/bun — провайдер и файловый API под Bun.h11-fs/node — провайдер, файловый API и connect-адаптер под Node.import { serveFiles } from 'h11-fs';
h11.get('/assets/**', serveFiles({ dir: './public', prefix: '/assets/' }));
prefix обрезается от начала URL перед поиском файла в dir; путь пользователя проходит через joinUserPath из h11 (защита от ..).
Bun:
import { createBunProvider } from 'h11-fs/bun';
const provider = createBunProvider({ h11 });
Bun.serve({
port: 3000,
fetch: (req, server) => provider(req, server),
});
Node:
import { createServer } from 'node:http';
import { createNodeProvider } from 'h11-fs/node';
const provider = createNodeProvider({ h11 });
createServer((req, res) => {
provider({ req, res, origin: 'http://localhost:3000' });
}).listen(3000);
createConnectAdapter (в h11-fs/node) оборачивает произвольный connect-middleware ((req, res, next) => void) в обычный Handler для h11 — этим пользуется h11-x, чтобы прозрачно проксировать dev-сервер Vite:
import { createConnectAdapter } from 'h11-fs/node';
h11.use(
'/_dev',
createConnectAdapter({
prefixToRemove: '/_dev',
connectMiddleware: someConnectApp, // например vite.middlewares
})
);
Регистрировать именно через h11.use(), а не h11.get(..., '/**') — middleware матчится для любого HTTP-метода, а .get()-wildcard только для GET (у connect-приложений вроде Vite dev-сервера бывают не только GET-запросы).
getFsApi() — асинхронно определяет рантайм (Bun/node:process.versions.node/др.) и возвращает подходящую реализацию FsApi (getFileStream, writeFile, checkExist, mkdir, copyFile, rm, ...). h11-x использует эту абстракцию, чтобы работать одинаково под обоими рантаймами.
bun run build # три entry-point'а: h11-fs.ts, providers/bun/fsapi.ts, providers/node/fsapi.ts
bun run types
FAQs
Раздача статики и провайдеры рантайма для [`h11`](../h11): подключает `H11`-инстанс к `Bun.serve` или `node:http`, и умеет отдавать файлы с диска.
We found that h11-fs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.