简体   繁体   English

如何在javascript / jquery中解压缩bzip2数据?

[英]How to decompress bzip2 data in javascript/jquery?

I have data coming from the API in the bzip2 compressed format. 我有来自bzip2压缩格式的API数据。 How do i decompress it to string in client side (jquery/js) ? 如何在客户端(jquery / js)中将其解压缩为字符串?

If client and server are designed to handle the application/x-bzip2 you don't have a lot of work to do. 如果客户端和服务器被设计为可以处理application/x-bzip2您无需做很多工作。 If you need to decompress raw streams you can try these libraries 如果您需要解压缩原始流,可以尝试这些库

https://github.com/antimatter15/bzip2.js

or 要么

https://github.com/kirilloid/bzip2-js

If you're using npm you could look at 如果您使用的是npm,可以看看

https://www.npmjs.com/package/bzip2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM