Please, just to clear something up in my head...
I am used to writing using asynchronous functions in libraries, but how do I write my own?
To illustrate my
Asynchronicity in NodeJS processes happens when you delegate some work to external processes (or probably some work in Node's C layer), that are e.g. database queries, file system operations.
Usually there's no asynchronicity in plain JavaScript functions (Node.js is single threaded) there are not many valid cases for that. However, if it's really heavy, and you really want to do that, you may either delegate your work to other process (see child_process.fork) or split operations with help of setTimeout (to give process a breathe to handle other request), then indeed it should be configured as asynchronous function.