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

calqlate

v0.2.1

Published

A nodejs module for performing calculations

Downloads

10

Readme

calqlate

A nodejs module for performing calculations

Usage

add

Takes any number of values, at least 2, and adds them together.

var calqlate = require('calqlate');
add = calqlate.add;
var a = 1;
var b = 2;
var c = 3
console.log(add(1, 2));
console.log(add(a, b, c));
console.log(multiply(a, 2, c, 4));

subtract

Takes any number of values, at least 2, and subtracts them.

var calqlate = require('calqlate');
subtract = calqlate.subtract;
var a = 1;
var b = 2;
var c = 3
console.log(subtract(1, 2));
console.log(subtract(a, b, c));
console.log(multiply(a, 2, c, 4));

multiply

Takes any number of values, at least 2, and multiplies them.

var calqlate = require('calqlate');
multiply = calqlate.multiply;
var a = 1;
var b = 2;
var c = 3
console.log(multiply(1, 2));
console.log(multiply(a, b, c));
console.log(multiply(a, 2, c, 4));

divide

Takes any number of values, at least 2, and divides them.

var calqlate = require('calqlate');
divide = calqlate.divide;
var a = 1;
var b = 2;
var c = 3
console.log(divide(1, 2, 3));
console.log(divide(a, b, c));
console.log(divide(a, 2, c, 4));

squareArea

Takes two sides of a square and calculates the area. Supporting both quadrat and rectangle.

var calqlate = require('calqlate');
squareArea = calqlate.squareArea;
var a = 1;
var b = 2;
console.log(squareArea(1, 2)); // calculate rectangle
console.log(squareArea(a, b)); // calculate rectangle
console.log(squareArea(a, 2)); // calculate rectangle
console.log(squareArea(a)); // calculate quadrat
console.log(squareArea(3)); // calculate quadrat

squarePerimiter

Takes two sides of a square and calculates the perimiter. Supporting both quadrat and rectangle.

var calqlate = require('calqlate');
squarePerimiter = calqlate.squarePerimiter;
var a = 1;
var b = 2;
console.log(squarePerimiter(1, 2)); // calculate rectangle
console.log(squarePerimiter(a, b)); // calculate rectangle
console.log(squarePerimiter(a, 2)); // calculate rectangle
console.log(squarePerimiter(b));  // calculate quadrat
console.log(squarePerimiter(3)); // calculate quadrat

squareDiagonalLength

Takes two sides of a square and calculates the diagonal length. Supporting both quadrat and rectangle.

var calqlate = require('calqlate');
squareDiagonalLength = calqlate.squareDiagonalLength;
var a = 1;
var b = 2;
console.log(squareDiagonalLength(1, 2)); // calculate rectangle
console.log(squareDiagonalLength(a, b)); // calculate rectangle
console.log(squareDiagonalLength(a, 2)); // calculate rectangle
console.log(squareDiagonalLength(b)); // calculate quadrat
console.log(squareDiagonalLength(3)); // calcualte quadrat

circleRadius

Takes the diameter and calculates the radius of a circle.

var calqlate = require('calqlate');
circleRadius = calqlate.circleRadius;
var a = 3;
console.log(circleRadius(a));
console.log(circleRadius(3));

circleCircumference

Takes the diameter and calculates the circumference of a circle.

var calqlate = require('calqlate');
circleCircumference = calqlate.circleCircumference;
var a = 3;
console.log(circleCircumference(a));
console.log(circleCircumference(3));

circleDiameter

Takes the radius and calculates the diameter of a circle.

var calqlate = require('calqlate');
circleDiameter = calqlate.circleDiameter;
var a = 3;
console.log(circleDiameter(a));
console.log(circleDiameter(3));

triangleArea

Takes the base and height and calculates the height of a triangle.

var calqlate = require('calqlate');
triangleArea = calqlate.triangleArea;
var a = 3;
var b = 4;
console.log(triangleArea(a, b));
console.log(triangleArea(3, 4));

trianglePerimiter

Takes the base and two sides of a triangle and calculates the perimiter.

var calqlate = require('calqlate');
trianglePerimiter = calqlate.trianglePerimiter;
var a = 3;
var b = 4;
var c = 5;
console.log(triangleArea(a, b, c));
console.log(triangleArea(3, 4, 5));

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 0.1.0 Initial release
  • 0.2.0 Adding circle, triangle and square calculation formulas
  • 0.2.1 Update keywords and README