2.2.9 • Published 3 years ago

abswap v2.2.9

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

abswap - Swap Files or Directories using Symlinks

dependencies  tests  npm  code size  license

Screencast

Features

  • Work with directories and regular files.
  • Maintain valid symlink for the activated selection (atomicity behavior).
  • Convert existing file or directory to a/b structure.

Install

npmyarn
npm install --global abswapyarn global add abswap

CLI Usage

Usage: abswap [options] <path>

Options:
  -V, --version  output the version number
  --init         initialize a path for a/b swap
  --copy         copy existing path to inactive selection on initialize
  --file         expect (or create) regular files as targets
  --directory    expect (or create) directory as targets
  --undo         delete a/b structure and keep active selection
  --verify       verify a/b structure for consistence
  -h, --help     output usage information

Programmatic Usage

const { init, swap, undo } = require("abswap");

const PATH = "/tmp/example-path";

async function demo() {
  // Initialize a/b structure
  await init(PATH, { directory: true, copy: true });

  // Swap symlinks pointing to 'a' and 'b'.
  await swap(PATH);

  // Undo a/b structure and keep current selected directory.
  await undo(PATH);
}

Changelog

v2.2.0

  • New option --verify to check for a valid a/b structure.

v2.1.0

  • Version is read asynchronously and only on demand from package.json.

v2.0.0

  • Complete asynchronous interface using promises.

v1.0.0

  • New option --undo to convert a/b structure back to a simple file or directory.

v0.3.0

  • New option --copy to copy existing file or directory to inactive selection on initialize.

v0.2.0

  • Can convert existing files or directories.
  • New options --file and --directory to select file or directory mode.

v0.1.3

  • Initial public version.

Contributing

Pull requests, patches, emails, issues, what ever, are welcomed!

Author

Built With

License

This project is licensed under the MIT License - see LICENSE for details.

2.2.9

3 years ago

2.2.8

3 years ago

2.2.7

3 years ago

2.2.6

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

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

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago