{"id":17383602,"url":"https://github.com/mrothnet/abswap","last_synced_at":"2025-04-15T09:53:32.537Z","repository":{"id":34983194,"uuid":"194169660","full_name":"mrothNET/abswap","owner":"mrothNET","description":"Swap a/b directories or files using symlinks","archived":false,"fork":false,"pushed_at":"2023-01-07T04:13:30.000Z","size":1481,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T08:46:04.105Z","etag":null,"topics":["cli","directory","file","javascript","shell","swap","symlink"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrothNET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-27T22:13:09.000Z","updated_at":"2021-08-11T20:03:59.000Z","dependencies_parsed_at":"2023-01-15T11:27:55.477Z","dependency_job_id":null,"html_url":"https://github.com/mrothNET/abswap","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrothNET%2Fabswap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrothNET%2Fabswap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrothNET%2Fabswap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrothNET%2Fabswap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrothNET","download_url":"https://codeload.github.com/mrothNET/abswap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048714,"owners_count":21204306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","directory","file","javascript","shell","swap","symlink"],"created_at":"2024-10-16T07:43:13.202Z","updated_at":"2025-04-15T09:53:32.508Z","avatar_url":"https://github.com/mrothNET.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `abswap` - Swap Files or Directories using Symlinks\n\n![dependencies](https://img.shields.io/librariesio/release/npm/abswap.svg?style=flat-square)\u0026nbsp;\u0026nbsp;![tests](https://img.shields.io/circleci/build/github/mrothNET/abswap/master.svg?label=tests\u0026style=flat-square)\u0026nbsp;\u0026nbsp;![npm](https://img.shields.io/npm/v/abswap.svg?style=flat-square)\u0026nbsp;\u0026nbsp;![code size](https://img.shields.io/github/languages/code-size/mrothNET/abswap.svg?style=flat-square)\u0026nbsp;\u0026nbsp;![license](https://img.shields.io/github/license/mrothNET/abswap.svg?style=flat-square)\n\n![Screencast](./assets/screencast-example.gif)\n\n\n## Features\n\n  * Work with directories and regular files.\n  * Maintain valid symlink for the activated selection (atomicity behavior).\n  * Convert existing file or directory to a/b structure.\n\n\n## Install\n\n|              npm              |           yarn           |\n|:-----------------------------:|:------------------------:|\n| `npm install --global abswap` | `yarn global add abswap` |\n\n\n## CLI Usage\n\n```\nUsage: abswap [options] \u003cpath\u003e\n\nOptions:\n  -V, --version  output the version number\n  --init         initialize a path for a/b swap\n  --copy         copy existing path to inactive selection on initialize\n  --file         expect (or create) regular files as targets\n  --directory    expect (or create) directory as targets\n  --undo         delete a/b structure and keep active selection\n  --verify       verify a/b structure for consistence\n  -h, --help     output usage information\n```\n\n## Programmatic Usage\n\n```javascript\nconst { init, swap, undo } = require(\"abswap\");\n\nconst PATH = \"/tmp/example-path\";\n\nasync function demo() {\n  // Initialize a/b structure\n  await init(PATH, { directory: true, copy: true });\n\n  // Swap symlinks pointing to 'a' and 'b'.\n  await swap(PATH);\n\n  // Undo a/b structure and keep current selected directory.\n  await undo(PATH);\n}\n```\n\n\n## Changelog\n\n**`v2.2.0`**\n  - New option `--verify` to check for a valid a/b structure.\n\n**`v2.1.0`**\n  - Version is read asynchronously and only on demand from `package.json`.\n\n**`v2.0.0`**\n  - Complete asynchronous interface using promises.\n\n**`v1.0.0`**\n  - New option `--undo` to convert a/b structure back to a simple file or directory.\n\n**`v0.3.0`**\n  - New option `--copy` to copy existing file or directory to inactive selection on initialize.\n\n**`v0.2.0`**\n  - Can convert existing files or directories.\n  - New options `--file` and `--directory` to select file or directory mode.\n\n**`v0.1.3`**\n  - Initial public version.\n\n\n## Contributing\n\nPull requests, patches, emails, issues, what ever, are welcomed!\n\n\n## Author\n\n  * [Michael Roth](https://mroth.net/) [\u003c\u003cmail@mroth.net\u003e\u003e](mailto:mail@mroth.net)\n\n\n## Built With\n\n  * [TypeScript](https://www.typescriptlang.org/) - JavaScript that scales.\n  * [Jest](https://jestjs.io/) - Delightful JavaScript Testing.\n  * [TSLint](https://palantir.github.io/tslint/) - An extensible linter for the TypeScript language.\n  * [Prettier](https://prettier.io/) - Opinionated Code Formatter.\n  * [Visual Studio Code](https://code.visualstudio.com/) - Code editing. Redefined.\n\n\n## License\n\nThis project is licensed under the MIT License - see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrothnet%2Fabswap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrothnet%2Fabswap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrothnet%2Fabswap/lists"}