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

discounted-cash-flow

v1.0.1

Published

Calculates the present value of future cash flows with a margin of safety.

Downloads

20

Readme

discounted-cash-flow

Discounted cash flow (DCF) is a valuation method used to estimate the value of an investment based on its expected future cash flows. DCF analysis attempts to figure out the value of an investment today, based on projections of how much money it will generate in the future.

The purpose of DCF analysis is to estimate the money an investor would receive from an investment, adjusted for the time value of money. The time value of money assumes that a dollar today is worth more than a dollar tomorrow because it can be invested. As such, a DCF analysis is appropriate in any situation where a person is paying money in the present with expectations of receiving more money in the future.

References

Discounted Cash Flow (DCF)

How To Calculate Intrinsic Value, Investing with Tom.

Installation

npm install discounted-cash-flow --save

How to use

Check tests folder for examples.

const DiscountedCashFlow = require("discounted-cash-flow");

DiscountedCashFlow.calculate(
  firstFreeCashFlow,
  [growthRate],
  terminalFcfMultiple,
  discountRate,
  decimals);

Example output:

{
	"futureCashFlows": [
		58.9, 65.96,
		73.88, 82.74,
		92.67, 99.16,
		106.1, 113.53,
		121.48, 129.98
	],
	"presentValueFutureCashFlows": [
		53.54, 54.52, 55.51,
		56.52, 57.54, 55.97,
		54.45, 52.96, 51.52,
		50.11
	],
	"valueFutureSale": 1949.7,
	"presentValueFutureSale": 751.69,
	"totalPresentValue": 1294.33
}

inputs

firstFreeCashFlow

The first free cash flow that will be grown and discounted.

growthRate

The growthRates that will be applied should be provided as an array. Each value of this array will affect a portion of the years depending on the amount of values provided. The maximum number of years on the analysis is 10.

Example: [0.05, 0.02] - the applied growth rate will be 5% for the first 5 years and 2% for the last 5.

Example: [0.07] - the applied growth rate will be 7%.

terminalFcfMultiple

Expected price to free cash flow ratio at the end of the calculation.

discountRate

The rate at which each future cash flow will be discounted at.

decimals

Desired rounding precision. Defaults to 2.

outputs

futureCashFlows

Estimation of the nominmal future cash flows using the provided growth rate.

presentValueFutureCashFlows

Present value of each one of the future cash flows discounted to the present.

valueFutureSale

Last free cash flow x terminalFcfMultiple

presentValueFutureSale

Value of future sale discounted into present value.

totalPresentValue

Sum of present value of future sale plus the sum of every future cash flow discounted into present value.

Represents the intrinsic value of company operation or the "fair" enterprise value of the company.

Test

npm run test