brctl-monitor
Monitor the CloudDocs deamon. brctl-monitor spawns brctl
in monitor mode. Which in turn uses NSMetadataQuery to monitor the chosen container
usage
const Brctl = require(`brctl-monitor`)
Brctl()
.then(brctl => {
brctl.state.on(`data`, state => {
console.log(JSON.stringify(state, null, 2))
})
})
.catch(e => console.error(e))
brctl-monitor takes an optional options-object:
to restrict the NSMetadataQuery scope:
Brctl({ scope: `both` || `docs` || `data` })
monitoring a specific container:
Brctl({ container: Brctl.ICLOUD_DRIVE })