vamtiger-evaluate-function
Evaluate a defined function.
Last updated 2 years ago by vamtiger-project .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vamtiger-evaluate-function 
SYNC missed versions from official npm registry.

VAMTIGER Evaluate Function

VAMTIGER Evaluate Function can evaluate a defined function.

Installation

VAMTIGER Evaluate Function can be installed using npm or yarn:

npm i --global vamtiger-evaluate-function 

or

yarn global vamtiger-evaluate-function

Usage

Import or require a referece to VAMTIGER Evaluate Function :

import evaluateFunction from 'vamtiger-evaluate-function';

or

const evaluateFunction = require('vamtiger-evaluate-function').default;

VAMTIGER Evaluate Function can evaluate a defined function

const result = evaluateFunction({
        formula: '-x^2 + 6x - 11',
        x: 2
    })
    .then(handleResult)
    .catch(handleError);

If SymPy is installed, the function can also be evaluated by specifying the python option:

async someAsyncFunction function() {
    const result = evaluateFunction({
        formula: '-x**2 + 6*x - 11', // Python Syntax
        x: 2,
        python: true
    })
    .then(handleResult)
    .catch(handleError);
}

Since VAMTIGER Evaluate Function returns a Promise, it can be more conveniently executed within an async function:

async someAsyncFunction function() {
    const result = await evaluateFunction({
        formula: '-x^2 + 6x - 11',
        x: 2
    });
}

When installed globally, the result can be logged from the commandline:

vamtiger-evaluate-function --formula "-x^2 + 6x - 11" --x "4x - 1"

or

vamtiger-evaluate-function --formula "-x**2 + 6*x - 11" --x "4*x - 1" --python

Current Tags

  • 0.0.9                                ...           latest (2 years ago)

7 Versions

  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 1
Last Week 1
Last Month 7
Dependencies (7)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |