Miss any of our Open RFC calls?Watch the recordings here! »

pretty-xl-formula

0.0.5 • Public • Published

pretty-xl-formula

build status AppVeyor Build Status JavaScript Style Guide


Prettify xl excel formulas.


Get it

npm install --save pretty-xl-formula

Usage

prettify(formula[, opts])

Just pass a formula to the prettifier. The options object is optional, it defaults to the values shown below.

const prettify = require('pretty-xl-formula')
const defaults = { indentType: ' ', indentLength: 2 }
 
prettify('sum(A3,A4%A5)', defaults)
// -> 'sum(\n  A3,\n  A4 % A5\n)'

CLI

pretty-xl-formula also exposes a cli as pxlf. It is just a transform stream that reads input from files or stdin and writes output to stdout.

You should install pretty-xl-formula globally to get the cli on your path instantly.

npm install -g pretty-xl-formula

Now you can do stuff like...

cat xlformula.txt | pxlf -il=4 > pretty.txt

Check out pxlf -h.

usage:
    pxlf file
  or
    pxlf < file
  or
    echo sum(A2,A3) | pxlf
  or
    cat file | pxlf > pretty.txt
  or
    pxlf -il=4 sum(B5,B7)
  or
    ...

  file: text file containing an excel formula
  -il: indent length, defaults to -il=2

  when using this cli indent type always is " "

License

MIT

Install

npm i pretty-xl-formula

DownloadsWeekly Downloads

2

Version

0.0.5

License

MIT

Last publish

Collaborators

  • avatar