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

ant-simple-calculator

v1.0.0

Published

<!-- @format -->

Downloads

1

Readme

API SERVICE FOR CALCULATOR in Node.js,MongoDB and Typescript

This is API SERVICE FOR CALCULATOR in node.js project using typescript and mongodb. To connect with database we are using mongoose ODM.

Authors

Contact Details

Tech Stack

  • TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Express - Node Framweork.

  • Nodemon - Use for development file reload.

  • CORS - a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.

  • Winston - A multi-transport async logging library for node.js.

  • mongoose - ODM library for mongoDB.

  • Helmet - Library to increase security of node server.

Logging

  • winston - a multi-transport async logging library for Node.js. It is designed to be a simple and universal logging library with support for multiple transports. A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at different levels. For example, one may want error logs to be stored in a persistent remote location (like a database), but all logs output to the console or a local file.
  • morgan - HTTP request logger middleware for Node.js. A helper that collects logs from your server, such as your request logs.

Tests

  • mocha - Test Framweork for JavaScript.
  • chai - Assertion library for javascript.

Install

Install the package from NPM:

# If you use NPM
npm install ant-simple-calculator

Usage

The package provides a calculator class in which there are four function Add,Subtract,Multiply and Divide. You can import npm as follow.

import Calculator from "ant-simple-calculator";
const calculator = new Calculator();

You can call Add function so that you need to pass two number which you want to Add

const AddTwoNumber = async (num1, num2) => {
  const AddNumber = await calculator.Add(num1, num2);
  console.log("Add Two Number: ", AddNumber);
};
AddTwoNumber(2, 4);

You can call Subtract function so that you need to pass two number which you want to Subtract

const SubtractTwoNumber = async (num1, num2) => {
  const AddNumber = await calculator.Subtract(num1, num2);
  console.log("Subtract Number: ", AddNumber);
};
SubtractTwoNumber(10, 2);

You can call Multiply function so that you need to pass two number which you want to Multiply

const MultiplyTwoNumber = async (num1, num2) => {
  const AddNumber = await calculator.Multiply(num1, num2);
  console.log("Multiply Number: ", AddNumber);
};
MultiplyTwoNumber(3, 4);

You can call Divide function so that you need to pass two number which you want to Divide

const DivideTwoNumber = async (num1, num2) => {
  const AddNumber = await calculator.Divide(num1, num2);
  console.log("Divide Number: ", AddNumber);
};
DivideTwoNumber(10, 2);

Keywords

Calculator API Axios

THANK YOU