1.0.18 • Published 3 years ago

webext-buildtools-dir-reader-mw v1.0.18

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

npm-publish

Introduction

webext-buildtools middleware builder for reading manifest file and packing Web Extension directory to zip file. Expected to be used to provide inputs for further builders.

If you need a complete solution for Web Extension build/deploy, go to webext-buildtools-integrated-builder repo.

To read what are webext-buildtools and builders go to webext-buildtools-builder-types repo.

Installation

npm install webext-buildtools-dir-reader-mw

Usage example

const DirReaderBuilder = require('webext-buildtools-dir-reader-mw').default;

const options = { zipOutPath: './out/ext.zip' };
const logMethod = console.log;
const builder = new DirReaderBuilder(options, logMethod);

builder.setInputDirPath('./ext_dir');

builder.requireZipFile();
builder.requireManifest();

const buildResult = await builder.build();

Options

Options object described in declarations/options.d.ts

See how to get logMethod for pretty output.

Inputs

  • setInputDirPath(...). Path to Web Extension directory

Outputs

zip

directory packed to zip

Required options: zipOutPath (for not temporary file) Require methods: requireZipFile(), requireZipBuffer() Assets: const buffer = buildResult.getAssets().zipBuffer.getValue() const zipFilePath = buildResult.getAssets().zipFile.getValue()

manifest

Object with parsed manifest file

Require methods: requireManifest() Assets: const manifestObj = buildResult.getAssets().manifest.getValue()

1.0.18

3 years ago

1.0.17

4 years ago

1.0.16

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago