Socket
Socket
Sign inDemoInstall

ktx-parse

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ktx-parse

KTX 2.0 (.ktx2) parser and serializer.


Version published
Weekly downloads
225K
increased by5.1%
Maintainers
1
Weekly downloads
 
Created

What is ktx-parse?

The ktx-parse npm package is a utility for parsing KTX (Khronos Texture) files, which are used for storing textures in a standardized format. This package allows developers to read and manipulate KTX files in JavaScript, making it useful for applications that need to handle texture data, such as game engines, 3D rendering applications, and other graphics-related software.

What are ktx-parse's main functionalities?

Parsing KTX Files

This feature allows you to parse a KTX file and extract its contents. The code sample demonstrates how to read a KTX file from the filesystem and parse it using the ktx-parse package.

const ktxParse = require('ktx-parse');
const fs = require('fs');

const ktxData = fs.readFileSync('path/to/texture.ktx');
const parsedKTX = ktxParse(ktxData);
console.log(parsedKTX);

Accessing Texture Data

This feature allows you to access the raw texture data from a parsed KTX file. The code sample shows how to extract the texture data from the first mip level of the parsed KTX file.

const ktxParse = require('ktx-parse');
const fs = require('fs');

const ktxData = fs.readFileSync('path/to/texture.ktx');
const parsedKTX = ktxParse(ktxData);
const textureData = parsedKTX.levels[0].levelData;
console.log(textureData);

Extracting Metadata

This feature allows you to extract metadata from a KTX file. The code sample demonstrates how to read the key-value metadata pairs from a parsed KTX file.

const ktxParse = require('ktx-parse');
const fs = require('fs');

const ktxData = fs.readFileSync('path/to/texture.ktx');
const parsedKTX = ktxParse(ktxData);
const metadata = parsedKTX.keyValue;
console.log(metadata);

Other packages similar to ktx-parse

FAQs

Package last updated on 15 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc