Detailed How-To for building API Client libraries in Node.js. Client design and architecture using encapsulation and resources.
To achieve this, your Node.js client should only expose users to the public version of your API and never the private, internal implementation. If you’re coming from a more traditional Object Oriented world, you can think of the public API as behavior interfaces. Concrete implementations of those interfaces are encapsulated in the private API. In Node.js too, functions and their inputs and output should rarely change. Otherwise you risk breaking backwards compatibility.
Encapsulation creates lot of flexibility to make changes in the underlying implementation.
Via Jan Hesse