Giter VIP home page Giter VIP logo

patch-asar's Introduction

Patch Asar

Using this library you can inject your own files into .asar archives.

Basic Usage

const patchAsar = require('patch-asar')
const path = require('path')

const inputAsar = path.join(__dirname, "input.asar")
const patchFolder = path.join(__dirname, "patches")

patchAsar(inputAsar, patchFolder).then(()=>{
	console.log("Successfully Patched .asar archive in place")
}).catch(error => {
	console.log(error)
})

Passing Additional Options

You can supply an object as the third argument to supply additional options.

...
await patchAsar(inputAsar, patchFolder, {outputFile: path.join(__dirname, 'output.asar')})
...

Available Options

outputFile

The output .asar file path. If this option is not provided it will overwrite the original .asar file.

workingDirectory

Allows you to specify the directory you would like the library to work in

.patch-execute files

A file ending in .patch-execute will be evaluated as Javascript in order to generate it's contents. The .patch-execute extension will be removed automatically during the build process. It should either export a string, or a function returning a string, or a promise returning a string. If you return a function while theres another file with the same name except without .patch-execute then the contents of the file will be passed in as a string input to your function. This can be very useful in order to generate the contents of the patched file based on the contents of the unpatched file and the code you provide in your .patch-execute file.

patch-asar's People

Contributors

l1lith avatar

Stargazers

 avatar Socheat Sok avatar Claudia Pellegrino avatar Eduardo Rabelo avatar Glenn 'devalias' Grant avatar  avatar d5stroy5r avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.