myeasycalc

2.1.2 • Public • Published

HOW TO INSTALL

  1. Make a new project directory:
    $ mkdir easyCalc
  2. Check login in npmjs.com:
    $ npm login
  3. Iniciate a new npm project:
    $ cd easyCalc
    $ npm init -f
  4. Lastly, install 'myeasycalc' package:
    $ npm install myeasycalc

After a clean instalation, these are the files should came up:

        package-lock.json
        package.json
        node_modules:
            package-lock.json
            myeasycalc:
                easyCalc.js
                easyCalc.ts
                package.json
                readme.md
                test.js
                test.ts
                virtualCalc.js
                virtualCalc.ts

HOW TO USE

The package has two classes:

  1. EasyCalc class.
    First, import the class in order to use it:
    import { EasyCalc } from './node_modules/myeasycalc/easyCalc'
    The class contains four methods (sum, rest, multiplication and division),
    wich are ready to apply basic aritmetic operations. All of them are listen
    for an (optional) argument, in form of array of numbers, to operate with and
    as return, a calculated number is obtained.

    If no argument is passed at the invocation moment, these methods
    will be delivering a result anyway operating from two random numbers.
    console.log(myObjetCalc.suma());

    It is posible invoque these methods with or without an instance
    from the class.
    console.log(new EasyCalc().resta([3,2]));
    console.log(EasyCalc.resta([3, 2]));

    There are Get and Set methods to call or update every attribute
    into the class.

    The last method is used to erease all value in every attribute
    and initialice them with value 0.
    myObjetCalc.reset();

  2. VirtualCalc class.
    First, import the class in order to use it:
    import { VirtualCalc } from './node_modules/myeasycalc/virtualCalc'
    This class has only one method: pint() An argument EasyCalc objet
    must be provide and as return, the class deliver every calculation
    results in a calculator simulation skin.
    myVirtualCalc(myObjetCalc);


The file 'test.ts' includes a full display of examples using
both classes and all their methods and attributes.

Readme

Keywords

Package Sidebar

Install

npm i myeasycalc

Weekly Downloads

0

Version

2.1.2

License

ISC

Unpacked Size

50.1 kB

Total Files

9

Last publish

Collaborators

  • ansatha