@noartem/xews
v1.1.0
Published
CLI for transferring files through Exchange drafts over EWS
Maintainers
Readme
@noartem/xews
xews is a small CLI for transferring files through Exchange Web Services by using attachments on the first draft message.
It is useful when you already have EWS access and want a simple way to upload, list, download, and clear files through Exchange without opening a mail client.
It can also synchronize one local folder through a dedicated draft-based channel. Sync sends changes as compressed batch attachments and removes each package after it is applied.
Install
Install from a local checkout:
npm linkAfter that, the CLI is available globally as:
xewsInstall from npm after publishing:
npm install -g xewsConfiguration
You can let xews create and open the config for you:
xews initOr create ~/.config/xews/auth.json manually:
{
"email": "[email protected]",
"password": "your-password",
"url": "https://exchange.example.com/EWS/Exchange.asmx"
}Required fields:
emailpasswordurl
xews init opens the file in your default terminal editor. It first checks VISUAL, then EDITOR, and falls back to vi.
Usage
Typical file transfer flow:
xews upload --file ./archive.zip
xews ls
xews download
xews sync --dir ./data --channel team-aShow help:
xews --helpUpload one or more files to the first draft:
xews upload --file ./file1.txt --file ./file2.pdfDownload all attachments from the first draft into the current directory:
xews downloadDownload attachments and delete the draft after download:
xews download --deleteList attachments from the first draft:
xews list
xews lsClear all attachments from the first draft:
xews clearSynchronize one local folder through a dedicated draft subject:
xews sync --dir ./tmp/a --channel local-testRun a single sync cycle and exit:
xews sync --dir ./tmp/a --channel local-test --onceCommands
init: create~/.config/xews/auth.jsonif needed and open it in your default editorupload: attach one or more files to the first draftdownload: download all file attachments from the first draft into the current directorylist/ls: show attachment names and sizes from the first draftclear: remove all attachments from the first draftsync: synchronize one folder through a dedicated draft channel likexews-sync:<channel>
Publish
Preview the package contents:
npm pack --dry-runPublish to npm:
npm publishFor a scoped public package:
npm publish --access public