npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cashy

v1.2.0

Published

Bookkeeping stuff

Downloads

6

Readme

Cashy

Cashy is a software designed for nerd compatible bookkeeping. Of course it offers an API for Node.js and a CLI tool with f*cking beautiful ANSI string color magic. With cashy you can split your bank account virtually into several sub accounts or combine bank accounts, cash boxes, money socks, ... to one logical account. The idea of writing such a tool arose from Ledger - a wonderful piece of software but with a little show stopper: Immutable transactions are not enforced by design and must be implemented by convention. (Don't remove lines from the database or a sweet kitten will die!)

The main difference to ledger and (most?) of its clones is that cashy uses a SQLite database instead of just text files. Indeed, this is not very sexy but it is a good compromise between easy handling (e.g. you don't need a database server) and transaction based storing of data. That way it is not too easy edit transactions by hand; you always must use cashy to alter things, which enforces the user not to screw things up.

My use case: I'm using my bank account not just for myself but also as a shared account with my flat mate (let's call him Steve) for all expenses related to our flat. Thus, the available money on my bank account does not all belong to me (unfortunately!) but also to Steve. So I needed a tool to keep track of my balances and expenses. Furthermore, I can easily generate account statements for Steve filtering out all transactions not related to our flat stuff. So I don't have to be embarrassed if I buy things at ... well you know ... and pay them by transfer ;)

Installation

npm install -g cashy

Further details for the interface: API.md.

Concept

Cashy holds several accounts in a hierarchical structure. That way you can group financial transactions logically. Example: I split the flat account into two sub accounts: flat/jue and flat/steve. So we can easily see who forgot to transfer the monthly contribution ;)

Transactions have to occur between at least two accounts. And they always must be balanced, i.e. the sum of all amounts must be zero. If you want to know the reason, drop "double-entry accounting" into your favourite search engine. As mentioned above, transactions are immutable once they have been committed. This ensures consistency and Steve can be sure that account statements are final and won't change in the future.

Example

Back to my use case ... let's jump right in how I organised everything.

First of all, we need a new database. This command will create cashy.sqlite in the current directory:

Create the database

Then add some accounts. I grouped them into assets, where all the money can be found, and liabilities that tells us to whom the money belongs to.

Create accounts

Adding transactions to the database goes like this. They represent the following flows of money:

  • My employer transferred my salary.
  • Steve transferred his contribution to the flat account
  • I transferred the rent to our landlord.

If you look carefully at the "Contribution Steve" transaction, you will see that the amount of "assets/hipsterBank" is missing. This amount will be calculated based on the fact that - as mentioned earlier - transactions always must be balanced.

The last command line commits all transactions. After this point they cannot be altered anymore, i.e. I cannot correct the misspelled "Salery" anymore ;)

Add transactions

Listing all transactions may help you to get a better overview what happened with the last commands.

Display all transactions

Here you can see the balances of all accounts. It may seems confusing but at this point the balance of the account at hipster bank is actually positive. A negative value on asset accounts means you own money. A positive value says you owe money. This is due to the fact that transactions always must be positive. ~~If you think this is confusing write a little wrapper inverting all amounts at assets accounts ;)~~ Good news: The latest version has the invert feature. Check out the API page.

Display balances of all accounts

If you specify an account along with the list command you can list just transactions related to the stated account.

Display transaction related to certain accounts

Command Line Interface

Well ... I'm going to describe this later in detail. For now stick with the built-in help:

cashy --help
cashy [command] --help