# @adhikari_mithun/function_evaluator

> A package to evaluate a string to a function.

Latest version **1.0.2** (published 2019-05-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @adhikari_mithun/function_evaluator
pnpm add @adhikari_mithun/function_evaluator
yarn add @adhikari_mithun/function_evaluator
bun add @adhikari_mithun/function_evaluator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-05-02 |
| First published | 2019-05-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mithun |
| Maintainers | adhikari_mithun |
| Keywords | node, npm, eval, @adhikari_mithun/function_evaluator, function_evaluator |

## Links

- npm: https://www.npmjs.com/package/@adhikari_mithun/function_evaluator
- Repository: https://github.com/mithunadhikari40/function_evaluator
- Homepage: https://github.com/mithunadhikari40/function_evaluator#readme
- Issues: https://github.com/mithunadhikari40/function_evaluator/issues
- npm.io page: https://npm.io/package/@adhikari_mithun/function_evaluator

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-05-02
- 1.0.1 — 2019-05-02
- 1.0.0 — 2019-05-02

## README

# function_evaluator
A package that evaluates a given string as function

This module is a simple way to evaluate a string content as an expression. 
Passing other than string to this module throws an error.

Download

It is published on node package manager (npm). To install, do:

`
npm i @adhikari_mithun/function_evaluator`


Usage

`
var evaluate = require('@adhikari_mithun/function_evaluator')`

`var res = _evaluate(content,callback)`

The following options are available:

content (String): the content to be evaluated

callback (Function) : the function to be called when the expression
is evaluated or some error is thrown.

# Example
`
var evaluate = require('@adhikari_mithun/function_evaluator')`

`var res = evaluate('let m = 123; exports.x = x',function(res,err){
    // => res === { x: 123 }
});`


`
res = evaluate('module.exports = function () { return 123 }',function(res,err){
// => res() === 123
});`

`
res = evaluate(13,function(res,err){
// => err === "This expression requires only string and not other"
});`

---
_Source: https://npm.io/package/@adhikari_mithun/function_evaluator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
