1.2.2 • Published 6 years ago

inspect-f v1.2.2

Weekly downloads
5,212
License
MIT
Repository
github
Last release
6 years ago

inspect-f

NPM Version Dependencies Build Status Code Coverage

Cast a function to string and adjust its indentation. Intended for rendering function bodies in pre-tags or consoles and what have you.

npm install --save inspect-f

Usage

Let's say we have this deeply indented function which uses a 6-space indentation scheme:

          function someDeeplyIndentedFunction(a, b){
                return (
                      a + b
                );
          }

Then the following:

const inspectf = require('inspect-f');
console.log(inspectf(2, someDeeplyIndentedFunction));

Would output:

function someDeeplyIndentedFunction(a, b){
  return (
    a + b
  );
}