# mytacism

> Evaluates statically-analyzable expressions in Javascript

Latest version **0.2.2** (published 2016-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mytacism
pnpm add mytacism
yarn add mytacism
bun add mytacism
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2016-06-23 |
| First published | 2015-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Flaise |
| Maintainers | flaise |
| Keywords | static, eval, analysis, static analysis, preprocessor, preprocess, evaluation |

## Links

- npm: https://www.npmjs.com/package/mytacism
- Repository: https://github.com/Flaise/mytacism
- Issues: https://github.com/Flaise/mytacism/issues
- npm.io page: https://npm.io/package/mytacism

## Recent versions

- 0.2.2 (latest) — 2016-06-23
- 0.2.1 — 2015-10-29
- 0.2.0 — 2015-10-28
- 0.1.1 — 2015-10-27
- 0.1.0 — 2015-10-26
- 0.0.0-alpha.2 — 2015-10-25
- 0.0.0-alpha.1 — 2015-10-23
- 0.0.0-alpha — 2015-10-22

## README

Mytacism
---

Evaluates statically analyzable expressions in Javascript and can evaluate injected compile-time
constants and functions. Inspired by
[static-eval](https://github.com/substack/static-eval), which at the time of writing was a promising
but incomplete solution.


Installation
---

    npm install --save-dev mytacism


Usage
---

Basic usage:

    var mytacism = require('mytacism')
    
    var options = {}
    var source = '1 + 1'
    var result = mytacism(source, options)
    
    console.log(result.code) // 2

You can also pass values in the options parameter to be used in computations:

    var mytacism = require('mytacism')
    
    var source = '1 + a'
    var result = mytacism(source, {values: {a: 2}})
    
    console.log(result.code) // 3
    
You can also pass functions to be statically executed:

    var mytacism = require('mytacism')
    
    var source = '1 + foo(1)'
    var result = mytacism(source, {functions: {foo: function(a) { return a + 2 }}})
    
    console.log(result.code) // 4

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