brotli을(를) 1.x에서 2.x로 업그레이드하기
brotli 1.3.3과 2.1.0의 공개 API를 TypeScript 타입에서 자동으로 비교한 결과입니다. 시그니처 변경은 호환성이 깨질 가능성이 있다는 뜻이며 확정은 아닙니다.
요약
| 삭제된 import 경로 | 0 |
|---|---|
| 삭제된 export | 0 |
| 변경된 시그니처 | 2 |
| 삭제된 클래스·인터페이스 멤버 | 0 |
| 변경된 클래스·인터페이스 멤버 | 0 |
| 새로 지원 중단됨 | 0 |
| 요구 사항 변경 (engines, peer 의존성) | 0 |
| 새 export | 4 |
삭제된 export
감지되지 않았습니다.
변경된 시그니처
| export | 이전 | 이후 |
|---|---|---|
brotli · compress | (buffer: Buffer, options?: CompressOptions | undefined): Uint8Array<ArrayBufferLike> | null | (buffer: string | ArrayLike<number>, options?: boolean | CompressOptions | undefined): Promise<Uint8Array<ArrayBufferLike> | null> |
brotli · decompress | (buffer: Buffer, outputSize?: number | undefined): Uint8Array<ArrayBufferLike> | (buffer: ArrayLike<number>, outSize?: number | null | undefined): Uint8Array<ArrayBufferLike> |
삭제된 클래스·인터페이스 멤버
감지되지 않았습니다.
변경된 클래스·인터페이스 멤버
감지되지 않았습니다.
새로 지원 중단됨
감지되지 않았습니다.
요구 사항 변경 (engines, peer 의존성)
감지되지 않았습니다.
새 export (4)
| import | export | kind |
|---|---|---|
brotli | CompressOptions | interface |
brotli/compress | compress | function |
brotli/compress | CompressOptions | interface |
brotli/decompress | decompress | function |
두 버전 사이의 changelog
패키지 작성자가 공개한 텍스트를 그대로 표시합니다.
2.1.0
### Changed
- Use the nullish coalescing (??) operator to check if the value is defined (#38)
- Use imports field to ship differential implementation for node and browser2.0.0
### Changed
- **Breaking:** Converted the package to ESM only. All public entry points use
named `compress` and/or `decompress` exports with no default export.
- **Breaking:** `compress()` now returns `Promise<Uint8Array | null>` and must
be awaited. Compression options, output bytes, and `null` results are unchanged.
`decompress()` remains synchronous.
- Public entry points are limited to the package root, `brotli/compress`, and
`brotli/decompress`, including `.js` aliases for both standalone modules.
Standalone modules export their named function.
- Encoder initialization is deferred until the first compression call. Concurrent
calls share one initialization Promise, including failures, with no automatic
retries. Initialization and runtime errors reject the compression Promise.
- Removed top-level await and enabled modern Node.js `require()` through every
public entry point. Unflagged ESM loading is supported in Node 20.19+, 22.12+,
and later releases; see the [Node documentation](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require).
The distribution remains ESM only.
- Encoding still runs on the calling thread without workers. Keep the input,
options, and dictionary unchanged until compression settles; no input copying
is added.
### Added
- TypeScript declarations for the package root and standalone modules, including
their `.js` aliases and the `CompressOptions` type.
- Tests for ESM and CommonJS exports, lazy and shared initialization, Promise
results and failures, and browser bundles, including dictionary initialization
and decompression without the encoder.
### Migration
```javascript
import { compress, decompress } from 'brotli';
const compressed = await compress(input);
const original = decompress(compressed);
```
To load either function independently:
```javascript
import { compress } from 'brotli/compress';
import { decompress } from 'brotli/decompress';
```
Modern Node.js CommonJS consumers can destructure named exports from the root
or standalone modules:
```javascript
const { compress, decompress } = require('brotli');
// Alternatively: const { compress } = require('brotli/compress');
compress(input).then(compressed => {
const original = decompress(compressed);
}).catch(console.error);
```
Older Node.js CommonJS consumers can continue to use dynamic `import()`.이 데이터를 AI 에이전트에 제공하세요
Vigia는 무료 MCP 서버입니다. 코딩 에이전트가 코드를 작성하기 전에 버전, 호환성을 깨는 변경, 취약점을 확인합니다. 가입도 API 키도 필요 없습니다.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Cursor에 추가VS Code에 추가★ GitHub에서 스타 누르기
그 밖의 MCP 클라이언트
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }에이전트 스킬(SKILL.md): 에이전트에게 Vigia를 언제 쓸지 알려 줍니다 · 풀 리퀘스트용 GitHub Action
자주 묻는 질문
brotli을(를) 1에서 2(으)로 업그레이드할 때 호환성이 깨지는 변경은 무엇인가요?
brotli 1.3.3과 2.1.0 사이에서 Vigia는 삭제된 export 0개, 변경된 시그니처 2개, 삭제되거나 변경된 클래스·인터페이스 멤버 0개를 찾았습니다.
brotli 2에서 지원 중단된 것은 무엇인가요?
brotli 2.1.0에서 export 또는 멤버 0개가 새로 지원 중단으로 표시되었습니다.
에이전트용
GET https://vigia.coredls.cloud/v1/packages/npm/brotli/upgrade?from=1.3.3&to=2.1.0