Package Exports
- daniel-san
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (daniel-san) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Copyright 2019 Jared Boice (MIT License / Open Source)
Daniel-San - Summarized Documentation
get the full documentation at gitHub.
Donations - Bitcoin: 19XgiRojJnv9VDhyW9HmF6oKQeVc7k9McU (use this address until 2020)
Description
Daniel-San is a node-based budget-projection engine that helps your finances find balance. The program offers multi-frequency accounting triggers, including: once, daily, weekly, bi-weekly, tri-weekly, monthly, annually and more. And special adjustments allow the movement of process-dates beyond holidays and weekends.
Install, Import & Execute
Install
npm install --save daniel-san
Import
const findBalance = require('daniel-san');
const terminal = require('daniel-san/terminal');
const { STANDARD_EVENT, MONTHLY, WEEKLY, DAILY, FRIDAY, SATURDAY, SUNDAY } = require('daniel-san/constants');
Defining Accounts/Cashflow Rules
const danielSan = {
beginBalance: 1618.03,
endBalance: null, // future end balance is stored here
dateStart: '2019-03-20', // always required
dateEnd: '2019-12-13', // required except when using the STANDARD_EVENT with a frequency of ONCE
rules: [
{ // rule 1
name: 'monthly bitcoin investment',
amount: -79.83, // negative amount subtracts, positive amount adds
type: STANDARD_EVENT, // see "Event Types" - import from constants.js
frequency: MONTHLY,
processDate: '30', // for MONTHLY events, this string represents the day within that month
dateStart: '2019-01-01' // date to start evaluating and processing this account
dateEnd: null, // null dateEnd represents an ongoing account
modulus: 1, // not required - see "Modulus/Cycle" to review this advanced feature
cycle: 1 // not required - see "Modulus/Cycle" to review this advanced feature
},
{ // rule 2
name: 'shenanigans',
amount: -97.00,
type: STANDARD_EVENT, // see "Event Types" - import from constants.js
frequency: WEEKLY,
processDate: FRIDAY, // 0-6 with 0 representing Sunday - weekday constants are available to be imported
dateStart: '2019-01-01',
dateEnd: null,
modulus: 2, // the modulus/cycle attributes here equate to every other Weekday (in this particular case due to the WEEKLY frequency)
cycle: 1,
syncDate: '2019-08-12' // specific to "Modulus/Cycle" - read that section for instructions
},
{ // rule 3
type: STANDARD_EVENT,
frequency: DAILY,
name: 'cafeteria breakfast',
amount: -5.00,
dateStart: '2019-01-01',
dateEnd: null,
exclusions: { // (exclusion hits will still cycle the modulus for STANDARD_EVENTS
weekdays: [SATURDAY, SUNDAY], // exclusions these weekdays
dates: ['15', '30'], // exluding these dates on each month
exactDates: ['2019-07-04', '2019-09-17', '2019-10-31'] // exluding these specific dates
}
}
],
events: [] // future balance projections stored here
};
const craneKick = findBalance(danielSan);