Asar 1.0.0

dotnet add package Asar --version 1.0.0
                    
NuGet\Install-Package Asar -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Asar" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asar" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Asar" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Asar --version 1.0.0
                    
#r "nuget: Asar, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Asar@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Asar&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Asar&version=1.0.0
                    
Install as a Cake Tool

Asar

Target Framework

Asar is a high-performance, full-featured C# library designed for the modern .NET ecosystem. It provides a robust and intuitive API for reading, writing, and manipulating ASAR (Atom Shell Archive) files—the standard packaging format for Electron applications.

Built with a focus on performance and developer productivity, Asar offers first-class support for random-access streaming, asynchronous I/O, and thread-safe operations, making it suitable for everything from simple extraction tools to complex build pipelines.


Key Features

  • 🚀 High Performance: Memory-efficient streaming and O(1) path resolution.
  • 🧵 Thread-Safe: Concurrent random-access reads powered by shared stream locking.
  • 🔄 Full Lifecycle Support: Create, Read, Update, and Delete (CRUD) operations on archives.
  • ⚡ Async-First: Comprehensive Task-based APIs for responsive applications.
  • 📦 Advanced Packing: Intelligent directory packing with glob filtering and native module (.unpacked) support.
  • 🛡️ Data Integrity: Preservation of Electron integrity blocks and POSIX executable bits.
  • 💎 Multi-Target: Optimized for .NET 8, 9, and 10.

Getting Started

Installation

Add the Asar package to your project via the NuGet CLI:

dotnet add package Asar

Quick Start

Read an existing archive
using Asar.Core;

// Open an archive for reading
using var archive = AsarArchive.Open("app.asar");

// Read file content directly
string config = archive.ReadAllText("config.json");

// Or use high-performance streaming for large files
using var stream = archive.OpenEntryStream("assets/video.mp4");
Modify and save
using var archive = AsarArchive.Open("app.asar");

// Update or add new files
archive.AddFile("main.js", "console.log('Patched!');");
archive.RemoveFile("old-asset.png");

// Save the changes
archive.Save("app-updated.asar");
Pack a directory
// Pack an entire folder with default Electron conventions
AsarPacker.Pack("./src", "app.asar");

Core Components

Component Responsibility
AsarArchive The primary façade for reading, modifying, and saving archives.
AsarReader Low-level, thread-safe reader providing random-access to entries.
AsarWriter High-level builder for creating new archives from various sources.
AsarPacker Specialized tool for converting directory trees into archives.

Why Asar?

Random-Access Guarantee

Unlike many archive libraries that require sequential scanning, Asar parses the archive header into an in-memory tree. This enables true random access: you can Seek to any byte in any file without reading the preceding data.

Optimized for Large Data

Whether you are working with a few kilobytes or several gigabytes, Asar maintains a constant memory footprint by leveraging modern .NET Stream and Span<byte> APIs.

Electron Compatibility

Asar is designed to be fully compatible with the official Electron asar tool. It correctly handles the companion .unpacked directories required for native .node modules and preserves file metadata across platforms.


Documentation

For more information, technical documentation, and usage examples, please visit the Github wiki page.


Feedback & Contribution

This project is maintained by Koray USTUNDAG. If you encounter any issues or have feature requests, please open an issue on the GitHub repository.


License

The Asar library is licensed under the MIT License.

Copyright © 2026 Koray USTUNDAG

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 111 4/28/2026

Initial release of Asar library.