1.0.2 • Published 3 years ago

christians-first-node-module v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

christians-first-node-module

Christian's First Node Module is a test package that I created in order to learn how NPM worked.

How to install it.

  1. Let's start with creating an npm project.
npm init
  1. Create the project hitting enter after filling everything out.

  2. Install the project.

npm install christians-first-node-module

How to start using it

This package has some basic functions which you can use right off when you install it.

  1. Create a file called index.js
  2. Inside the file index.js add the following code to get the functions inside of the package:
const {getArea, getSum, getDifference} = require('christians-first-node-module');
  1. Add the rest of the code in order to log the results.
const {getArea, getSum, getDifference} = require('christians-first-node-module');

// log the area of a square. You can change the numbers.
console.log(getArea(4, 4))

// log the area of a square. You can change the numbers.
console.log(getArea(4, 4))

// log the sum of two numbers. You can change the numbers.
console.log(getSum(1, 4))

// log the difference of two numbers. You can change the numbers.
console.log(getSum(10, 4))

Functions

FunctionDescription
getArea(width, height)Gets the Area of a square.
getSum(num1, num2)Gets the sum between two numbers.
getDifference(num1, num2)Gets the difference between two numbers.

More functions will be added with time.