fluent-interface-example v1.0.4
Fluent Interface Example
A fluent interface is a form of an API that allows chaining methods to simplify common activities, especially where multiple operations are executed or options are specified in series.
Ideally fluent interfaces should only be employed where readability is improved when the API is frequently leveraged as a series of combined actions.
Common examples of Fluent Interfaces are:
jQuery
$('.mySelector')
.hide()
.addClass('anotherClass')
.show();
Request
request
.get('http://google.com/img.png')
.on('response', function(response) {
console.log(response.statusCode) // 200
console.log(response.headers['content-type']) // 'image/png'
})
.pipe(request.put('http://mysite.com/img.png'))
Installation
# npm install -g fluent-interface-example
Usage
Follow installation instructions above to install the unit-convert tool globally.
Convert millimetres to feet
# unit-convert --convert 100 --from mm --to ftConvert celsius to fahrenheit
# unit-convert --convert 100 --from C --to FShow all possible conversion units
# unit-convert --possibilitiesShow all possible conversion units from a particular unit
# unit-convert --possibilities --from CRunning tests
# npm run testReleasing
This repository leverages git-flow (AVH) for its branding and merging strategy. Releasing is automated via the
generate-release tool.
Update patch version:
# npm run patchUpdate minor version:
# npm run release