1.0.18 • Published 2 years ago

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

Weekly downloads
2
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.17

2 years ago

1.0.16

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago