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

buildup-node

v1.0.2

Published

BuildUp module

Downloads

2

Readme

buildup-node

This module provides an access to the BuildUp APIs.

Installation

npm install buildup-node

BuildUp API keys

API keys are required for the module to work.

Usage

Import the module:

const { BuildUp } = require('buildup-node');

Create a new client instance:

const BuildUpClient = new BuildUp({
  key: 'API_KEY',
  secret: 'API_SECRET',
});

You can now access the provided APIs in your async functions.

Please notice: all of the requests should contain uid - a unique user identifier (string).

async function getRiskValue() {
  try {
    /* ... */

    const options = {
      riskGrowth: 5,
      riskLevel: 2,
      riskLosses: 4,
      riskVolatility: 2,
    };

    // add a user identifier to the options
    options.uid = User.identifier; // 'someUniqueIdentifierString'

    const riskValue = await BuildUpClient.getRiskValue(options);
    console.log(riskValue); // 3.25
  } catch (error) {
    /* ... */
  }
}

Available methods

getAccountOverview(options: AccountOverviewOptions)

This method provides Account Overview data based on the provided account data.

const options = { 
  IRAType: 'SEP IRA',
  contributionPercentage: 5,
  riskValue: 4,
  startDate: 1578988351,
  totalIncome: 15000,
};

// add a user identifier to the options
options.uid = User.identifier;

const accountOverview = await BuildUpClient.getAccountOverview(options);

Options:

  • IRAType - selected IRA Type (string)
  • comtributionPercentage - user's Contribution Percentage (number)
  • riskValue - calculated Risk Value (number)
  • startDate - a start date timestamp (10 digits, seconds) (number)
  • totalIncome - calculated Total Income (number)

Method returns an object:

{
  amountSaved: {
    amountSaved: 2000,
    contributionPercentage: 10,
    income: 20000
  },
  investmentEarnings: {
    amountSaved: 2000,
    annualReturnPercentage: 13.67,
    investmentEarnings: 273.5,
    returnPercentageGraph: [
         { date: 'Dec 18', returnPercentage: -8.38 },
         { date: 'Jan 19', returnPercentage: 8.16 },
         { date: 'Feb 19', returnPercentage: 3.18 },
         { date: 'Mar 19', returnPercentage: -0.03 },
         { date: 'Apr 19', returnPercentage: 3.06 },
         { date: 'May 19', returnPercentage: -5.65 },
         { date: 'Jun 19', returnPercentage: 5.39 },
         { date: 'Jul 19', returnPercentage: 0.06 },
         { date: 'Aug 19', returnPercentage: -2.31 },
         { date: 'Sep 19', returnPercentage: 1.62 },
         { date: 'Oct 19', returnPercentage: 2.42 },
         { date: 'Nov 19', returnPercentage: 2.69 },
         { date: 'Dec 19', returnPercentage: 2.33 }
    ]
  },
  taxesReduction: { amountInvested: 2000 },
  retirementSavings: { amountSaved: 3000 }
}

getAllocations(options: AllocationsOptions)

This method provides stock allocations based on the Risk Value.

const options = {
  riskValue: 5,
};

// add a user identifier to the options
options.uid = User.identifier;

const allocations = await BuildUpClient.getAllocations(options);

Options:

  • riskValue - calculated Risk Value (number)

Method returns an object:

{
  allocations: {
    SPAB: 10,
    VEA: 30,
    VOO: 30,
    VTWO: 30
  }
}

getIRAType(options: IRATypeOptions)

This method provides maximum contribution amount based on the selected IRA type.

const options = {
  IRAType: 'SEP IRA',
};

// add a user identifier to the options
options.uid = User.identifier;

const IRAData = await BuildUpClient.getIRAType(options);

Options:

  • IRAType - selected IRA Type (string)

Method returns an object:

{
  IRAType: 'SEP IRA',
  maxContribution: '15%'
}

getRiskValue(options: AnswersValues)

This method provides Risk Value based on the Risk Question answers.

const options = {
  riskGrowth: 5,
  riskLevel: 2,
  riskLosses: 4,
  riskVolatility: 2,
};

// add a user identifier to the options
options.uid = User.identifier;

const riskValue = await BuildUpClient.getRiskValue(options);

Options:

  • riskGrowth - Risk Question Answer (number)
  • riskLevel - Risk Question Answer (number)
  • riskLosses - Risk Question Answer (number)
  • riskVolatility - Risk Question Answer (number)

Method returns an object:

{
  riskValue: 3.25
}