npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bs-file-downloader

v0.1.3

Published

A block stream file downloader using WebAssembly

Downloads

2

Readme

Block Stream File Downloader

Chinese Version (中文版)

Block Stream File Downloader is an efficient, memory-friendly large file downloader implemented using WebAssembly. It utilizes a block streaming method to effectively handle large files while maintaining low memory usage. It is not suitable for ordinary file downloads but is specifically designed for downloading files stored in Block Stream format.

Table of Contents

Features

  • WebAssembly-based, providing high-performance file downloads
  • Uses block streaming processing, supporting large file downloads
  • Low memory usage, suitable for various environments
  • Supports multi-source downloads, improving download speed and stability
  • Built-in integrity checks to ensure downloaded file correctness

Installation

Using as an npm package

npm install bs-file-downloader

Building from source

  1. Clone the repository:
git clone https://github.com/Travisun/Block-Stream-File-Downloader.git
cd Block-Stream-File-Downloader
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Usage

import { BsFileDownloaderWrapper } from 'bs-file-downloader';

async function downloadFile() {
  const downloader = new BsFileDownloaderWrapper();
  await downloader.initialize();

  downloader.setBaseUrls(['https://example.com/files', 'https://backup.example.com/files']);

  const bsContent = '...'; // .bs file content

  try {
    const result = await downloader.downloadAndVerify(bsContent);
    console.log('Download completed:', result);
  } catch (error) {
    console.error('Download failed:', error);
  }
}

downloadFile();

For detailed API documentation, please refer to API.md.

Development Guide

  1. Ensure that Rust and Node.js are installed in your development environment.

  2. Install wasm-pack:

cargo install wasm-pack
  1. Run the following command in the project root directory to build the WebAssembly module:
wasm-pack build --target web
  1. After modifying the Rust code, re-run the above command to rebuild.

  2. Use npm run build to build the JavaScript wrapper.

Packaging Instructions

  1. Update the version numbers in Cargo.toml and package.json.

  2. Build the WebAssembly module:

wasm-pack build --target web
  1. Build the npm package:
npm run build
  1. Publish the npm package:
npm publish

Legal and Agreements

This project is governed by multiple legal documents. By using, modifying, or distributing this software, you agree to comply with all of the following agreements:

  1. MIT License
  2. User Agreement
  3. Disclaimer

Please read all of these documents carefully before using this software. Together, they constitute the complete legal framework for the use of this software.

Special Considerations

  1. This software must not be used for any illegal purposes, including but not limited to actions that violate the laws and regulations of China, the United States, or other applicable jurisdictions.

  2. Users must comply with all usage restrictions and conditions specified in the user agreement.

  3. When modifying, redistributing, using, or referencing this software in any form, all original agreement files must be retained and provided in full, including the user agreement, disclaimer, and license.

  4. This software is provided "as is" without any form of warranty. The authors and copyright holders are not responsible for any losses caused by the use of this software.

Please carefully read all relevant agreement files before using this software. If you do not agree to these terms, please do not use this software.

Contributing

We welcome and appreciate any form of contribution. Before submitting a Pull Request, please make sure you have read and agreed to our Contribution Guidelines.

Contact

If you have any questions or suggestions, please contact us through:


© 2024 Block Stream File Downloader Team, Investravis Team. All rights reserved.