Coder Social home page Coder Social logo

tar-sync's Introduction

tar-sync

tar-sync automates tar archive creation and synchronization with directory changes. It uses chokidar for monitoring directory changes and tar-fs for creating tar archives.

Motivation

The motivation behind developing tar-sync stemmed from the need for a reliable solution to synchronize a folder with a tarball file.

Features

  • Automatically creates tar archives from directory changes
  • Robust: Capable of handling concurrent changes without corrupting data

Use Cases

  • Backup Solution: Automatically create tar archives of critical data for regular backups.
  • Versioning and History: Maintain a history of changes made to a directory by creating tar archives.
  • Sharing and Distribution: Easily share snapshots of directories by packaging them into tar archives.

Example

Install tar-sync

npm install tar-sync

Import tar-sync and start with the path of the directory

const { TarSync } = require("tar-sync")

new TarSync("./test-folder").start()

new TarSync("./test-folder").stop() // Call stop when you want to stop sync changes

or

import { TarSync } from "tar-sync";

new TarSync("./test-folder").start()

new TarSync("./test-folder").stop() // Call stop when you want to stop sync changes

a tar file ./test-folder.tar should be generated.

Using with options:

import { TarSync } from "tar-sync";

// Example usage with custom options
const options = {
    outPath: "./output",                    // Specifies the output path for the tar archive
    triggerOnEvents: ['add', 'change'],     // Triggers the creation of a tar archive on 'add' and 'change' events
    watcherOpts: {},                        // Additional options for configuring the watcher
    tarOpts: {},                            // Additional options for configuring the tar creation process
    extension: ".tar",                      // Specifies the file extension for the tar archive
    fs: yourCustomFileSystemImplementation, // Specifies the file system implementation to use such as graceful-fs
    verbose: true                           // Enables verbose logging
};


new TarSync("./test-folder",options).start()

Support

For any issues, bugs, or feature requests, please submit an issue on GitHub.

License

tar-sync is licensed under the MIT License.

Contributing

Contributions are welcome! Feel free to fork the repository and submit a pull request with your changes.

tar-sync's People

Contributors

omarmhamza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.