TopGit theo dõi electron/asar trên GitHub trong nhóm Frontend, đã đạt 2.9k sao. Simple extensive tar-like archive format with indexing
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
ASAR is a simple extensive archive format. It concatenates all files together without compression
(like tar) while having random access support.
Features
Support random access
Use JSON to store file information
Very easy to write a parser
CLI
Install
This module requires Node 22.12.0 or later.
npm install --engine-strict @electron/asar
Usage
$ asar --help
Usage: asar [options] [command]
Commands:
pack|p <dir> <output>
create asar archive
list|l <archive>
list files of asar archive
extract-file|ef <archive> <filename>
extract one file from archive
extract|e <archive> <dest>
extract archive
Options:
-h, --help output usage information
-V, --version output the version number
asar pack app app.asar --unpack-dir "{**/x1,**/x2,z4/w1}"
Programmatic usage
For full API usage, see the API documentation.
Example
import { createPackage } from '@electron/asar';
const src = 'some/path/';
const dest = 'name.asar';
await createPackage(src, dest);
console.log('done.');
Please note that there is currently no error handling provided!
Transform
You can pass in a transform option, that is a function, which either returns
nothing, or a stream.Transform. The latter will be used on files that will be
in the .asar file to transform them (e.g. compress).
import { createPackageWithOptions } from '@electron/asar';
const src = 'some/path/';
const dest = 'name.asar';
function transform (filename) {
return new CustomTransformStream()
}
await createPackageWithOptions(src, dest, { transform: transform });
console.log('done.');
Format
Asar uses Pickle to safely serialize binary value to file.
offset and size records the information to read the file from archive, the
offset starts from 0 so you have to manually add the size of header_size and
header to the offset to get the real offset of the file.
offset is a UINT64 number represented in string, because there is no way to
precisely represent UINT64 in JavaScript Number. size is a JavaScript
Number that is no larger than Number.MAX_SAFE_INTEGER, which has a value of
9007199254740991 and is about 8PB in size. We didn't store size in UINT64
because file size in Node.js is represented as Number and it is not safe to
convert Number to UINT64.
integrity is an object consisting of a few keys:
A hashing algorithm, currently only SHA256 is supported.
A hex encoded hash value representing the hash of the entire file.
An array of hex encoded hashes for the blocks of the file (i.e. for a blockSize of 4KB, this array contains the hash of every block if you split the file into N 4KB blocks).
A integer value blockSize representing the size in bytes of each block in the blocks hashes above.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/electron/asar là nguồn chính thức.
electron/asar có bao nhiêu sao?
electron/asar có 2.9k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/electron/asar. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
electron/asar có phải mã nguồn mở không?
Có — electron/asar phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/electron/asar.
electron/asar còn đang phát triển không?
Commit gần nhất trên electron/asar là 12 ngày trước (theo timestamp GitHub). Repo có 263 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
electron/asar là gì?
electron/asar (electron/asar) là dự án TypeScript trên GitHub. Theo mô tả gốc: Simple extensive tar-like archive format with indexing
electron/asar so với các dự án Frontend khác thế nào?
electron/asar được TopGit xếp vào nhóm Frontend, với 2.9k sao GitHub và viết bằng TypeScript. Xem trang chủ đề Frontend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc asar có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về asar.