mikedeboer / jsDAV

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.
http://www.mikedeboer.nl
MIT License
681 stars 159 forks source link

How jsDAV callbacks work #158

Open birbird opened 7 years ago

birbird commented 7 years ago

Hi

I am new to jsDAV, and is taking over a project used jsDAV. Currently I want understand the work flow of jsDAV, specially how those callbacks work. I didn't find the answer in wiki, then ask here, hope it will not disturb.

Take jsDAV/lib/DAV/backends/fs/file.js for example. It uses callbacks like cbfsput, cbfsfileget, cbfsfiledel, etc heavily, the same situation in the project I am working on.

But I don't know where those callbacks come from. Does jsDAV define them? and where? And who calls those API and passes the callback parameter, where is the code?

Any help will be highly appreciated.