├── .github └── FUNDING.yml ├── .gitignore ├── .npmignore ├── .vscode └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── package.json ├── pnpm-lock.yaml ├── rollup.config.mjs ├── src ├── alphavantage.mjs ├── config │ ├── crypto-currency-codes.mjs │ ├── currency-codes.mjs │ └── index.mjs ├── formula.mjs ├── generator.mjs ├── main.mjs ├── transaction.mjs └── utils.mjs └── test ├── balance.test.mjs ├── beancount.test.mjs ├── close.test.mjs ├── comment.test.mjs ├── commodity.test.mjs ├── common.mjs ├── date.test.mjs ├── error.test.js ├── event.test.mjs ├── formula.test.js ├── note.test.mjs ├── open.test.mjs ├── option.test.mjs ├── pad.test.mjs ├── price.test.mjs ├── snap.test.mjs └── transaction.test.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: ["https://www.costflow.io/docs/donate/"] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | .DS_Store 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | *.pid.lock 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # Bower dependency directory (https://bower.io/) 28 | bower_components 29 | 30 | # node-waf configuration 31 | .lock-wscript 32 | 33 | # Compiled binary addons (https://nodejs.org/api/addons.html) 34 | build/Release 35 | 36 | # Dependency directories 37 | node_modules/ 38 | jspm_packages/ 39 | 40 | # TypeScript v1 declaration files 41 | typings/ 42 | 43 | # Optional npm cache directory 44 | .npm 45 | 46 | # Optional eslint cache 47 | .eslintcache 48 | 49 | # Optional REPL history 50 | .node_repl_history 51 | 52 | # Output of 'npm pack' 53 | *.tgz 54 | 55 | # Yarn Integrity file 56 | .yarn-integrity 57 | 58 | # dotenv environment variables file 59 | .env 60 | 61 | # next.js build output 62 | .next 63 | 64 | 65 | ## Output 66 | lib 67 | dist 68 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | test 3 | coverage 4 | tsconfig.json 5 | tslint.json 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "editor.formatOnSave": true, 4 | "cSpell.words": ["alphavantage", "beancount", "costflow", "hledger"] 5 | } 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Costflow 2 | 3 | Welcome, and thank you for your interest in contributing to Costflow! 4 | 5 | Please make sure that all Costflow Parser codes' behavior should follow the rules of [Costflow Syntax](https://docs.costflow.io/syntax/). 6 | 7 | ## Getting started 8 | 9 | Clone this repository and install its dependencies: 10 | 11 | ```bash 12 | git clone https://github.com/costflow/parser 13 | cd parser 14 | npm install 15 | ``` 16 | 17 | `npm run build` builds the library to `dist`, generating three files: 18 | 19 | - `dist/costflow.cjs.js` 20 | A CommonJS bundle, suitable for use in Node.js, that `require`s the external dependency. This corresponds to the `"main"` field in package.json 21 | - `dist/costflow.esm.js` 22 | an ES module bundle, suitable for use in other people's libraries and applications, that `import`s the external dependency. This corresponds to the `"module"` field in package.json 23 | - `dist/costflow.umd.js` 24 | a UMD build, suitable for use in any environment (including the browser, as a `