GithubHelp home page GithubHelp logo

tomjs / unzip-crx Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 486 KB

解压 Chrome 插件文件(*.crx)。unzip chrome extension files(*.crx).

License: MIT License

JavaScript 52.00% TypeScript 48.00%
chorme chrome-extension crx extension unzip

unzip-crx's Introduction

@tomjs/unzip-crx

npm node-current (scoped) NPM jsDocs.io

English | 中文

Unzip chrome extension files

If you want to unzip Chrome extension files (*.crx) you might have the problem that your unzip lib claims that the file header is malformed. This is due to that Chrome adds some extra information for identifying crx files. unzip-crx handles those additional headers and unzips as usual.

This library is based on Peerigon's unzip-crx, which makes simple modifications and adds esm and cjs support.

And this unzip-crx is highly inspired by crx2ff from abarreir and crxviewer from Rob Wu, thanks!

Install

# pnpm
pnpm add @tomjs/unzip-crx

# yarn
yarn add @tomjs/unzip-crx

# npm
npm add @tomjs/unzip-crx

Example

  • esm
import unzip from 'unzip-crx';

const crxFile = './this-chrome-extension.crx';

unzip(crxFile).then(() => {
  console.log('Successfully unzipped your crx file..');
});
  • cjs
const unzip = require('unzip-crx');

const crxFile = './this-chrome-extension.crx';

unzip(crxFile).then(() => {
  console.log('Successfully unzipped your crx file..');
});

Documentation

API

unzip(file[, destination])

  • file: string, the path to the file to unzip
  • destination: string, the path to the destination folder (optional)

Resolves with a Promise if the file was unzipped successfully, throws otherwise (use .catch()).

unzip-crx's People

Contributors

tomgao365 avatar

Stargazers

 avatar

Watchers

 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.