Socket
Book a DemoInstallSign in
Socket

format-call

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-call

Format a function call nicely

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

format-call

Format a function call nicely

screenshot

Example

var format = require('format-call');


console.log(format('console.log', ['foo', 'bar']));

console.log(format('foo', ['bar', { beep: 'boop', me: 'ow' }], 'stream'));

console.log(format('db.createReadStream', [{
  lt: 'z',
  gt: 'f',
  reverse: true,
  limit: 12,
  keyEncoding: 'utf8',
  valueEncoding: 'json'
}], 'readable'));

Installation

$ npm install format-call

API

format(name, args[, type])

Return a string to be written to a terminal for a function call consisting of

  • name the function name
  • args array of arguments
  • type optional return type

Conventions are applied to format args nicely:

  • callbacks are removed
  • option / value objects are displayed nicely

License

MIT

FAQs

Package last updated on 05 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts