azure-fileshare-util

0.4.3 • Public • Published

Azure File Share Util

A library for interfacing with Azure File Share

  • listening to changes and make callbacks with identified changes
  • backing up files
  • downloading files
  • uploading files

Motivation

By listening to Azure File Share changes it is possible to kick off processing pipelines as end users dump files into a file share.

How to setup

Gets dependencies

npm install

How to use

Listen

For each change identified the callback receives an entity of the following form

{
    name: <filename>,
    action: <one of create or update>
}
  • Define your callback to handle the change ...which is an entity with keys 'name' and 'action
  • Define your config which references Azure
  • Instantiate the listener with the config
  • Request to listen with changes delivered to your callback
let mycallback =(change)=>{
    let { name, action} = change
    ...handle change to file
}
let config = {
      POLL_FREQUENCY: 10000,
      account: <azure account>,
      accountKey: <azure access key>,
      shareName: <azure file name>,
      directoryName: <azure directory>
    }
let listener = Listener(config)
listener.listen(mycallback)

How to develop

npm start

This will lint the source, run the tests

How to view implementation debug

export DEBUG=listener,listener.test

Readme

Keywords

none

Package Sidebar

Install

npm i azure-fileshare-util

Weekly Downloads

0

Version

0.4.3

License

MIT

Unpacked Size

16.3 kB

Total Files

9

Last publish

Collaborators

  • philxceptionale