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

cartera

v2.1.0

Published

investment portfolio

Downloads

8

Readme

cartera is portfolio in Catalan

investment portfolio

NPM

Usage

Cartera portfolios are JSON files like this:

{
  "portfolio": [
    {
      "currency": "BCH",
      "open": {
        "when": "2017-08-01",
        "bought": {
          "amount": 2
        }
      },
      "close": {
        "when": "2018-06-20T05:00:00.000Z"
      }
    },
    {
      "currency": "ETH",
      "open": {
        "when": "2017-08-01",
        "bought": {
          "amount": 2
        }
      },
      "close": {
        "when": "2018-06-20T05:00:00.000Z"
      }
    }
  ]
}

The default portfolio location is ~/Documents/Cartera/portfolio.json and you can specify a custom path via cartera --path <path/file.json>.

Running cartera with the above will output a result that looks like this:

{
  items: [
    {
      currency: 'BCH',
      open: {
        when: '8/1/2017, 8:00:00 AM',
        bought: {
          amount: 2,
          currency: 'BCH',
          price: 0.002276504200150249
        },
        sold: {
          currency: 'USD',
          amount: 878.54,
          price: 439.27
        },
        market: {
          USD: {
            USD: 1,
            BCH: 0.002277
          },
          BCH: {
            USD: 439.27,
            BCH: 1
          }
        },
        value: {
          USD: 878.54,
          BCH: 2
        }
      },
      close: {
        when: '6/20/2018, 1:00:00 PM',
        bought: {
          currency: 'USD',
          amount: 1800.34,
          price: 900.17
        },
        sold: {
          currency: 'BCH',
          amount: 2,
          price: 0.0011109012742037616
        },
        market: {
          USD: {
            USD: 1,
            BCH: 0.001111
          },
          BCH: {
            USD: 900.17,
            BCH: 1
          }
        },
        value: {
          USD: 1800.34,
          BCH: 4.0984815716985
        },
        changes: {
          USD: {
            amount: 921.8,
            difference: '104.92%',
            remaining: '204.92%'
          },
          BCH: {
            amount: 2.0984815716984997,
            difference: '104.92%',
            remaining: '204.92%'
          }
        }
      }
    },
    {
      currency: 'ETH',
      open: {
        when: '8/1/2017, 8:00:00 AM',
        bought: {
          amount: 2,
          currency: 'ETH',
          price: 0.004426737494466578
        },
        sold: {
          currency: 'USD',
          amount: 451.8,
          price: 225.9
        },
        market: {
          ETH: {
            USD: 225.9,
            ETH: 1
          },
          USD: {
            USD: 1,
            ETH: 0.004427
          }
        },
        value: {
          USD: 451.8,
          ETH: 2
        }
      },
      close: {
        when: '6/20/2018, 1:00:00 PM',
        bought: {
          currency: 'USD',
          amount: 1072.38,
          price: 536.19
        },
        sold: {
          currency: 'ETH',
          amount: 2,
          price: 0.0018650105373095357
        },
        market: {
          ETH: {
            USD: 536.19,
            ETH: 1
          },
          USD: {
            USD: 1,
            ETH: 0.001865
          }
        },
        value: {
          USD: 1072.38,
          ETH: 4.74714475431607
        },
        changes: {
          USD: {
            amount: 620.5800000000002,
            difference: '137.36%',
            remaining: '237.36%'
          },
          ETH: {
            amount: 2.7471447543160696,
            difference: '137.36%',
            remaining: '237.36%'
          }
        }
      }
    }
  ],
  totals: {
    currency: 'USD',
    open: '$1330.34',
    close: '$2872.72',
    change: '$1542.38',
    difference: '115.94%',
    remaining: '215.94%'
  }
}

You can generate JSON output by using the --json flag:

{
  "items": [
    {
      "currency": "BCH",
      "open": {
        "when": "2017-08-01T00:00:00.000Z",
        "bought": {
          "amount": 2,
          "currency": "BCH",
          "price": 0.002276504200150249
        },
        "sold": {
          "currency": "USD",
          "amount": 878.54,
          "price": 439.27
        },
        "market": {
          "USD": {
            "USD": 1,
            "BCH": 0.002277
          },
          "BCH": {
            "USD": 439.27,
            "BCH": 1
          }
        },
        "value": {
          "USD": 878.54,
          "BCH": 2
        }
      },
      "close": {
        "when": "2018-06-20T05:00:00.000Z",
        "bought": {
          "currency": "USD",
          "amount": 1800.34,
          "price": 900.17
        },
        "sold": {
          "currency": "BCH",
          "amount": 2,
          "price": 0.0011109012742037616
        },
        "market": {
          "USD": {
            "USD": 1,
            "BCH": 0.001111
          },
          "BCH": {
            "USD": 900.17,
            "BCH": 1
          }
        },
        "value": {
          "USD": 1800.34,
          "BCH": 4.0984815716985
        },
        "changes": {
          "USD": {
            "amount": 921.8,
            "difference": 104.92407858492498,
            "remaining": 204.92407858492498
          },
          "BCH": {
            "amount": 2.0984815716984997,
            "difference": 104.92407858492498,
            "remaining": 204.92407858492498
          }
        }
      }
    },
    {
      "currency": "ETH",
      "open": {
        "when": "2017-08-01T00:00:00.000Z",
        "bought": {
          "amount": 2,
          "currency": "ETH",
          "price": 0.004426737494466578
        },
        "sold": {
          "currency": "USD",
          "amount": 451.8,
          "price": 225.9
        },
        "market": {
          "USD": {
            "USD": 1,
            "ETH": 0.004427
          },
          "ETH": {
            "USD": 225.9,
            "ETH": 1
          }
        },
        "value": {
          "USD": 451.8,
          "ETH": 2
        }
      },
      "close": {
        "when": "2018-06-20T05:00:00.000Z",
        "bought": {
          "currency": "USD",
          "amount": 1072.38,
          "price": 536.19
        },
        "sold": {
          "currency": "ETH",
          "amount": 2,
          "price": 0.0018650105373095357
        },
        "market": {
          "USD": {
            "USD": 1,
            "ETH": 0.001865
          },
          "ETH": {
            "USD": 536.19,
            "ETH": 1
          }
        },
        "value": {
          "USD": 1072.38,
          "ETH": 4.74714475431607
        },
        "changes": {
          "USD": {
            "amount": 620.5800000000002,
            "difference": 137.35723771580348,
            "remaining": 237.35723771580348
          },
          "ETH": {
            "amount": 2.7471447543160696,
            "difference": 137.35723771580348,
            "remaining": 237.35723771580348
          }
        }
      }
    }
  ],
  "totals": {
    "currency": "USD",
    "open": 1330.34,
    "close": 2872.7200000000003,
    "change": 1542.38,
    "difference": 115.93878256686263,
    "remaining": 215.93878256686264
  }
}

The default currency (which is also used for reporting) is USD and can be customised via cartera --currency <EUR>.

Discover the release history by heading on over to the HISTORY.md file.

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

No maintainers yet! Will you be the first?

No sponsors yet! Will you be the first?

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Unless stated otherwise all works are:

and licensed under: