@gpu-tex-enc/astc

中文文档
4.7.1发布于 2024/09/04Apache-2.0TypeScriptCommonJS零依赖近 30 天下载 7.5万

Compressing images using the ASTC texture compression standard.

原始使用文档
文档目录8 节
  1. Description
  2. Features
  3. Installation
  4. Usage
  5. Binaries
  6. Dependencies
  7. Repository
  8. License

@gpu-tex-enc/astc

Compressing images using the ASTC texture compression standard.

astcenc v4.6.1

Description

This module provides a Node.js interface for compressing images into ASTC format, an efficient texture compression standard suited for GPU textures. It wraps various astcenc binaries for different platforms and CPU architectures, ensuring broad compatibility and performance.

Features

  • Supports multiple CPU architectures and operating systems.
  • Easy integration with Node.js projects.
  • Utilizes the latest astcenc binaries for optimal compression.

Installation

Install the module via npm:

npm install @gpu-tex-enc/astc

Usage

To use this module, require it in your Node.js project:

const astc = require('@gpu-tex-enc/astc');

// Example usage here...

Binaries

The package includes pre-compiled astcenc binaries for the following platforms and architectures:

  • Linux (x64) - AVX2, SSE2, SSE4.1
  • Windows (x64, ARM64) - AVX2, SSE2, SSE4.1
  • Darwin (x64, ARM64) - AVX2, SSE2, SSE4.1

Dependencies

  • cpu-features: To determine the best binary for your CPU.

Repository

The source code is available on GitHub:

github.com/ddenisyuk/gpu-tex-enc

License

This project is licensed under the Apache-2.0 License.

版本与发布记录

@gpu-tex-enc/astc 共发布 3 个版本,首次发布于 2023/12/03;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.7.1latest2024/09/042 年前
4.7.02024/02/162 年前
4.6.12023/12/032 年前

关于 @gpu-tex-enc/astc 的常见问题

@gpu-tex-enc/astc 是什么?

Compressing images using the ASTC texture compression standard.

如何安装 @gpu-tex-enc/astc?

在项目目录运行 npm install @gpu-tex-enc/astc,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 astcenc-linux-x64-avx2、astcenc-linux-x64-sse2、astcenc-linux-x64-sse4.1、astcenc-win32-x64-avx2、astcenc-win32-x64-sse2、astcenc-win32-x64-sse4.1、astcenc-win32-arm64-avx2、astcenc-win32-arm64-sse2、astcenc-win32-arm64-sse4.1、astcenc-darwin-x64-avx2、astcenc-darwin-x64-sse2、astcenc-darwin-x64-sse4.1,可以用 npx astcenc-linux-x64-avx2 直接运行。

@gpu-tex-enc/astc 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gpu-tex-enc/astc 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@gpu-tex-enc/astc 可以商用吗?

@gpu-tex-enc/astc 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@gpu-tex-enc/astc 的下载量有多少?

根据 npm 官方下载统计,@gpu-tex-enc/astc 在 2026/10/17 – 2026/11/15 这 30 天内被下载 74,930 次,日均约 2,498 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gpu-tex-enc/astc 还在维护吗?

最新版本 4.7.1 发布于 2024/09/04(2 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/12/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。