open-index/open-npm huggingface dataset:
npm package: @prolifode/mkspiffs-wrapper
Description: Node.js wrapper for mkspiffs.
Author: Prolifode
Latest version: 1.0.13

# mkspiffs-wrapper

`mkspiffs-wrapper` is a Node.js wrapper for `mkspiffs`, a tool used to create and manage SPIFFS filesystems. This package allows you to pack and unpack SPIFFS files from within a Node.js environment.

## Installation

To install the package, use npm:

```bash
npm install mkspiffs-wrapper
```
Usage
Importing the Package
In your TypeScript file, import the Mkspiffs class:

```typescript
import Mkspiffs from 'mkspiffs-wrapper';
```
Creating an Instance
Create an instance of Mkspiffs:

```typescript
const mkspiffs = new Mkspiffs();
```

Packing Files
To pack files into a SPIFFS file, use the pack method:

```typescript
mkspiffs.pack('path/to/sourceDir', 'path/to/output.spiff', {
blockSize: 4096,
pageSize: 256,
spiffSize: 0x20000  // Size in bytes
}, (err: Error | null, output: string | null) => {
    if (err) {
        console.error('Error packing files:', err);
    } else {
        console.log('Pack output:', output);
    }
});
```
Unpacking Files
To unpack a SPIFFS file, use the unpack method:

```typescript
mkspiffs.unpack('path/to/input.spiff', 'path/to/outputDir', (err: Error | null, output: string | null) => {
    if (err) {
        console.error('Error unpacking files:', err);
    } else {
        console.log('Unpack output:', output);
    }
});
```

### TypeScript Support  
This package is written in TypeScript, and type definitions are included. You can use it directly in TypeScript projects for better type safety and autocompletion.

### Examples 
See the examples directory for usage examples in TypeScript.

### Contributing
If you'd like to contribute to this project, please fork the repository and create a pull request with your changes.

### License
This project is licensed under the MIT License. See the LICENSE file for details.

### Acknowledgments
Special thanks to the authors of mkspiffs for their tool and to the TypeScript community for their support.
npm package: @prolifode/spiffsgen-wrapper
Description: Node.js wrapper for ESP-IDF spiffsgen.py
Author: Prolifode
Latest version: 0.0.2

# SPIFFS Generation Wrapper

A TypeScript wrapper for generating and unpacking SPIFFS images using [spiffsgen.py](https://github.com/espressif/esp-idf/blob/v5.3.1/components/spiffs/spiffsgen.py)

## Table of Contents

- [Overview](#overview)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
    - [Packing a Directory](#packing-a-directory)
- [Configuration](#configuration)
- [License](#license)

## Overview

This wrapper provides an easy-to-use interface for creating and unpacking SPIFFS images with the help of `spiffsgen.py`. It determines the correct executable path based on the platform, ensures the script is executable, and simplifies command execution.

## Prerequisites

- [Node.js](https://nodejs.org/) (version 14 or higher)
- Python (version 3.x) installed and available in the system's PATH
- `spiffsgen.py` should be available in the `bin` directory or in the specified location in the script

## Installation

Clone the repository and navigate to the project directory:

```bash
git clone https://github.com/your-repo/spiffs-gen-wrapper.git
cd spiffs-gen-wrapper
```

## Install the dependencies:

```bash
npm install
```

## Usage

## Packing a Directory
Use the pack method to create a SPIFFS image from a directory:

```typescript
import SpiffsGen from 'SpiffsGen';

const spiffsGen = new SpiffsGen();

spiffsGen.pack(
    './data',               // Source directory
    'spiffs.bin',           // Output file
    { blockSize: 4096, pageSize: 256, spiffSize: 131072 }, // Options
    (error, stdout) => {
        if (error) {
            console.error('Failed to create SPIFFS image:', error);
        } else {
            console.log('SPIFFS image created successfully:', stdout);
        }
    }
);

```

## Configuration
### Options for Packing
- `blockSize`: The block size in bytes (default: 4096)
- `pageSize`: The page size in bytes (default: 256)
- `spiffSize`: The total size of the SPIFFS image in bytes (e.g., 131072 for 128 KB)

## Example Configuration

To use different options for generating a SPIFFS image:

```typescript
const options = {
    blockSize: 8192,       // Block size
    pageSize: 512,         // Page size
    spiffSize: 262144,     // Image size
};
```

## License

This project is licensed under the [MIT](https://github.com/Prolifode/spiffsgen-wrapper/blob/main/LICENSE) License
npm package: @proload/plugin-dotfile
Description: A proload plugin to support files with a leading dot
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-dotfile`

Enables the loading of `.[namespace]` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import dotfile from '@proload/plugin-dotfile';

load.use([dotfile]);
await load('namespace');
```
npm package: @proload/plugin-json
Description: A proload plugin to support .json and .jsonc files
Author: Nate Moore
Latest version: 0.3.1

# `@proload/plugin-json`

Enables the loading of `[namespace].config.json` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import json from '@proload/plugin-json';

load.use([json]);
await load('namespace');
```
npm package: @proload/plugin-kdl
Description: A proload plugin to support .kdl files
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-kdl`

Enables the loading of `[namespace].config.kdl` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import kdl from '@proload/plugin-kdl';

load.use([kdl]);
await load('namespace');
```
npm package: @proload/plugin-rc
Description: A proload plugin to support '[namespace]rc' files
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-rc`

Enables the loading of `[namespace]rc` files with any extension using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import rc from '@proload/plugin-rc';

load.use([rc]);
await load('namespace');
```
npm package: @proload/plugin-tsm
Description: A proload plugin to support TypeScript files using TSM
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-tsm`

Enables the loading of `[namespace].config.ts`, `[namespace].config.cts`, and `[namespace].config.mts` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import typescript from '@proload/plugin-tsm';

load.use([typescript]);
await load('namespace');
```
npm package: @proload/plugin-typescript
Description: A proload plugin to support TypeScript files
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-typescript`

Enables the loading of `[namespace].config.ts` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import typescript from '@proload/plugin-typescript';

load.use([typescript]);
await load('namespace');
```
npm package: @proload/plugin-yaml
Description: A proload plugin to support YAML files
Author: Nate Moore
Latest version: 0.2.1

# `@proload/plugin-yaml`

Enables the loading of `[namespace].config.yaml` or `[namespace].config.yml` files using [`@proload/core`](https://github.com/natemoo-re/proload).

```js
import load from '@proload/core';
import yaml from '@proload/plugin-yaml';

load.use([yaml]);
await load('namespace');
```