dl2-save-editor
v0.1.5
Published
This package is an extension of the DL2 Save Editor and allows its Rust logic to be implemented as an NPM package with the help of Rust WebAssembly.
Downloads
5
Readme
Why the Save Editor Logic Received Its Own NPM Package
Introduction
The Save Editor logic has been decoupled into its own NPM package to enhance modularity, maintainability, and reusability across different projects.
Benefits
- Modularity: By isolating the Save Editor logic into its own package, we can maintain a cleaner and more organized codebase. This separation of concerns allows developers to focus on specific functionalities without navigating through unrelated code.
- Maintainability: Having the Save Editor logic in a dedicated package makes it easier to manage and update. Bug fixes and feature enhancements can be implemented in one place, reducing the risk of introducing errors into other parts of the application.
- Reusability: With the Save Editor logic as an NPM package, it can be easily integrated into multiple projects. This promotes code reuse and reduces duplication, ultimately saving development time and effort.
- Versioning: The NPM package can be versioned independently, allowing developers to control when and how updates to the Save Editor logic are applied. This ensures stability and compatibility with existing projects.
Installation
To install the Save Editor NPM package, run the following command:
npm install dl2-save-editor
Usage
Once installed, you can import and use the Save Editor logic in your project as follows:
import { analyse_save } from 'dl2-save-editor';
const my_save = load_save_file(file_path, file_content, is_debugging);
// Use the Save Editor as needed
Conclusion
By isolating the Save Editor logic into its own NPM package, we achieve a more modular, maintainable, and reusable codebase that allows for web support and easier collaboration. This approach not only benefits the current project but also provides a robust solution for future development needs.
🔋 Batteries Included
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.LICENSE-APACHE
andLICENSE-MIT
: most Rust projects are licensed this way, so these are included for you
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Acknowledgements
This project was generated by
wasm-pack
usingwasm-pack-template
template.A template for kick starting a Rust and WebAssembly project using wasm-pack.
Built with 🦀🕸 by The Rust and WebAssembly Working Group