Skip to content

vhexl/vite-plugin-kaitai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-kaitai

Allows you to directly import Kaitai Struct (.ksy) files, including auto-generating some (somewhat rudimentary) type definitions.

Installation

npm i -D vite-plugin-kaitai kaitai-struct

vite.config.js

/** @type {import("vite").UserConfig} */
export default {
  plugins: [..., kaitai()],
}

tsconfig.json

{
  compilerOptions: {
    rootDirs: [
      "./",
      "./.svelte-kit/types", // add this too if you're using SvelteKit!
      "./generated",
    ],
  },
}

Usage

import FileFormat from "path/to/file-format.ksy"

const parsedFile = new FileFormat(fs.readFileSync(...))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.1%
  • Nix 3.9%