taxsim.js
from an html pagetaxsim()
javascript functionPromise
to retrieve the output<script src="taxsim.js"></script> <script> // taxsim.js implements a function with the following prototype: // // function taxsim(input: String): Promise // function taxsim(input: Object): Promise // // the returned promise can be manipulated either directly or via async/await // sample input let input1 = ["taxsimid,mstat,year,ltcg,idtl", "1,2,1970,100000,5"].join("\n") let input2 = {taxsimid: 1, mstat: 2, year: 1970, ltcg: 100000, idtl: 5} // promise api taxsim(input1).then(function(output) { console.log('taxsim output', output) }).catch(function(error) { console.log('taxsim failed', error) }) // async/await api try { let output = await taxsim(input2) console.log('taxsim output', output) } catch(error) { console.log('taxsim failed', error) } </script>
load a CSV file for local processing, output to results.raw in same directory
the output in the example below is calculated right here in your browser, using taxsim.js
the input is interactive, so you can modify the text and the output will recompute