# stream-saver-with-aes

> 基于Service Worker的文件流式下载，避免下载大文件时内存使用过大导致浏览器崩溃。

Latest version **0.1.0** (published 2021-06-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install stream-saver-with-aes
pnpm add stream-saver-with-aes
yarn add stream-saver-with-aes
bun add stream-saver-with-aes
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-06-22 |
| First published | 2021-06-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 70.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lxp |
| Maintainers | li7228166 |
| Keywords | file, stream, fileSaver, aes256, openssl |

## Links

- npm: https://www.npmjs.com/package/stream-saver-with-aes
- Homepage: https://github.com/li7228166/stream-saver-with-aes#readme
- Issues: https://github.com/li7228166/stream-saver-with-aes/issues
- npm.io page: https://npm.io/package/stream-saver-with-aes

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2021-06-22
- 0.0.8 — 2021-06-22
- 0.0.7 — 2021-06-22
- 0.0.6 — 2021-06-22
- 0.0.5 — 2021-06-16
- 0.0.4 — 2021-06-16
- 0.0.3 — 2021-06-16
- 0.0.2 — 2021-06-16
- 0.0.1 — 2021-06-16

## README

# stream saver with aes
基于Service Worker的文件流式下载，避免下载大文件时内存使用过大导致浏览器崩溃。

## 功能简介
* 流式文件下载
  * 支持ASE256解密(兼容OpenSSL: openssl aes-256-cbc -d -salt -pbkdf2 -iter 10000 -in encryptedFile -out decryptedFile)

## 引入

支持以下几种安装方式

    * 工程项目推荐使用es module引入，以便利用工程进行tree shaking优化

* 使用 NPM 安装(Yarn同理)
  ```
  npm install stream-saver-with-aes
  ```
  ```Javascript
  import FileSaveRegister from 'stream-saver-with-aes'
  // or
  const FileSaveRegister = require('stream-saver-with-aes')
  ```
  
---
## 使用
```Javascript
  const fileSave = new FileSaveRegister('/');
  fileSave.download(...);
  ```
  *** 需手动拷贝sswa-sw.js文件到站点根目录，以便获得全局Service Worker权限
  
  
## 【类】FileSaveRegister
```JavaScript
export default class FileSaveRegister {
    constructor(scope?: string, options?: {
        confirmMessage?: string;
        onMessage?: (data: any) => void;
    });

    download(filename: string, url: string | {path: string;url: string;}[], size?: number, options?: Partial<{
        password: string;
        cancel: (canceler: any) => void;
        onProgress: (loaded: number, size: number) => void;
    }>): void;
}
```

---
_Source: https://npm.io/package/stream-saver-with-aes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
