|
| 1 | +# @mongodb-js/zstd |
| 2 | + |
| 3 | +Zstandard compression library for Node.js |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +``` |
| 8 | +npm install @mongodb-js/zstd |
| 9 | +``` |
| 10 | + |
| 11 | +## Support matrix |
| 12 | + |
| 13 | +| | node12 | node14 | node16 | node17 | |
| 14 | +| ---------------- | ------ | ------ | ------ | ------ | |
| 15 | +| Windows x64 | ✓ | ✓ | ✓ | ✓ | |
| 16 | +| Windows arm64 | ✓ | ✓ | ✓ | ✓ | |
| 17 | +| macOS x64 | ✓ | ✓ | ✓ | ✓ | |
| 18 | +| macOS arm64 | ✓ | ✓ | ✓ | ✓ | |
| 19 | +| Linux x64 gnu | ✓ | ✓ | ✓ | ✓ | |
| 20 | +| Linux x64 musl | ✓ | ✓ | ✓ | ✓ | |
| 21 | +| Linux arm gnu | ✓ | ✓ | ✓ | ✓ | |
| 22 | +| Linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | |
| 23 | +| Linux arm64 musl | ✓ | ✓ | ✓ | ✓ | |
| 24 | +| Android arm64 | ✓ | ✓ | ✓ | ✓ | |
| 25 | +| Android armv7 | ✓ | ✓ | ✓ | ✓ | |
| 26 | +| FreeBSD x64 | ✓ | ✓ | ✓ | ✓ | |
| 27 | + |
| 28 | +## API |
| 29 | + |
| 30 | +```ts |
| 31 | +export function compress(buffer: Buffer | ArrayBuffer | Uint8Array, level: number): Promise<Buffer> |
| 32 | +export function decompress(buffer: Buffer): Promise<Buffer> |
| 33 | +``` |
| 34 | + |
| 35 | +### Bugs / Feature Requests |
| 36 | + |
| 37 | +Think you’ve found a bug? Want to see a new feature in `@mongodb-js/zstd`? Please open a |
| 38 | +case in our issue management tool, JIRA: |
| 39 | + |
| 40 | +- Create an account and login [jira.mongodb.org](https://jira.mongodb.org). |
| 41 | +- Navigate to the NODE project [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE). |
| 42 | +- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it. |
| 43 | + |
| 44 | +Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the |
| 45 | +Core Server (i.e. SERVER) project are **public**. |
| 46 | + |
| 47 | +### Support / Feedback |
| 48 | + |
| 49 | +For issues with, questions about, or feedback for the library, please look into our [support channels](https://docs.mongodb.com/manual/support). Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the [MongoDB Community Forums](https://community.mongodb.com/tags/c/drivers-odms-connectors/7/node-js-driver). |
| 50 | + |
| 51 | +### Change Log |
| 52 | + |
| 53 | +Change history can be found in [`HISTORY.md`](https://github.com/mongodb-js/zstd/blob/HEAD/HISTORY.md). |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +```ts |
| 58 | +import { compress, decompress } from '@mongodb-js/zstd'; |
| 59 | +
|
| 60 | +(async () => { |
| 61 | + const buffer = Buffer.from('test'); |
| 62 | + const compressed = await compress(buffer, 10); |
| 63 | + const decompressed = await decompress(compressed); |
| 64 | +})(); |
| 65 | +``` |
0 commit comments