1.0.13 • Published 11 months ago

@prolifode/mkspiffs-wrapper v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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:

npm install mkspiffs-wrapper

Usage Importing the Package In your TypeScript file, import the Mkspiffs class:

import Mkspiffs from 'mkspiffs-wrapper';

Creating an Instance Create an instance of Mkspiffs:

const mkspiffs = new Mkspiffs();

Packing Files To pack files into a SPIFFS file, use the pack method:

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:

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.

1.0.2

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago