Socket
Book a DemoInstallSign in
Socket

asar-lightweight

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asar-lightweight

A lightweight version of asar

1.3.1
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

asar-lightweight

asar-lightweight is a lightweight library to read and write asar archives.

It uses the same format as original asar files. Here you can read archives directly using buffers which means you have a total control over the archive, how you get it and how you store it.

Usage

Installation

$ npm install asar-lightweight

Importation

const asar = require('asar-lightweight'); // CommonJS

import * as asar from 'asar-lightweight'; // ES6

Reading

const asar = require('asar-lightweight');
const fs = require('fs');

// Getting the file from the file system (but you can get the Buffer from another source)
const archive = fs.readFileSync('/path/to/archive.asar');

// Now you can read it
// Remember the function is asynchronous
(async () => {
  const content = await asar.readArchive(archive);
  // Do stuff with `content`
})();

Writing

const asar = require('asar-lightweight');
const fs = require('fs');

// Getting the file from the file system (but you can get the Buffer from another source)
const archive = fs.readFileSync('/path/to/archive.asar');

// Now you can read it, edit the data and then write it back
// Remember those functions are asynchronous
(async () => {
  const content = await asar.readArchive(archive);

  // Do stuff with `content`

  const packed = await asar.writeArchive(content);
})();

Keywords

asar

FAQs

Package last updated on 01 Jul 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.