1.0.0 • Published 4 years ago

@plucth/ledger-autoinsert v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Ledger Autoinsert

Simple script to add transactions to ledger files.

Installation

npm install --save @plucth/ledger-autoinsert

Usage

Make a config file, it's just a ledger file with special lines for the repetion

autoinsert.dat

1m
2020-03-07 Payee1
  account1  CAD 20.00
  account2

2w
2020-02-09 Payee2
  account3  CAD 56.00
  account2

syntax for the repetition line is pretty straitforward it just a number an a unit of time (d for days, w for week and m for month.

Make a simple js script to pass options and that's it. The options are the config file we just created, the number of days for which to create the transactions and the target ledger file.

autoinsert.js

const autoinsert = require('@plucth/ledger-autoinsert');

autoinsert({
  configFile: 'autoinsert.dat',
  days: 120,
  file: '2020.dat'
})();

Run from time to time with

nodejs autoinsert.js

This would create transactions from configFile in file for the next days days. The config file dates changes for the next not created transaction.

1.0.0

4 years ago