Skip to content
/ asar Public
forked from electron/asar

Simple extensive tar-like archive format with indexing

License

Notifications You must be signed in to change notification settings

scottwey/asar

This branch is 7 commits ahead of, 218 commits behind electron/asar:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b1c637b · Sep 13, 2016
Jan 23, 2016
Sep 13, 2016
Aug 29, 2016
Aug 18, 2016
May 7, 2015
Aug 18, 2016
Aug 18, 2016
Aug 29, 2016
Dec 23, 2015
Sep 22, 2014
Sep 13, 2016
Aug 18, 2016
Dec 23, 2015
Sep 13, 2016

Repository files navigation

asar - Electron Archive

dependencies npm version

Asar is a simple extensive archive format, it works like tar that concatenates all files together without compression, while having random access support.

Features

  • Support random access
  • Use JSON to store files' information
  • Very easy to write a parser

Command line utility

Install

$ npm install original-fs-asar

Usage

Only runs inside of Electron.

Using programatically

Example

var asar = require('original-fs-asar');

var src = 'some/path/';
var dest = 'name.asar';

asar.createPackage(src, dest, function() {
  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).

var asar = require('original-fs-asar');

var src = 'some/path/';
var dest = 'name.asar';

function transform(filename) {
  return new CustomTransformStream()
}

asar.createPackageWithOptions(src, dest, { transform: transform }, function() {
  console.log('done.');
})

About

Simple extensive tar-like archive format with indexing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 92.6%
  • JavaScript 7.4%