# thelogic

> A Logic Engine written in TypeScript

Latest version **0.0.12** (published 2017-07-25) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2017-07-25 |
| First published | 2017-07-19 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom Harley |
| Maintainers | magnostherobot |
| Keywords | logic, typescript |

## Links

- npm: https://www.npmjs.com/package/thelogic
- Repository: https://github.com/magnostherobot/thelogic
- Homepage: https://github.com/magnostherobot/thelogic#readme
- Issues: https://github.com/magnostherobot/thelogic/issues
- npm.io page: https://npm.io/package/thelogic

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.12 (latest) — 2017-07-25
- 0.0.11 — 2017-07-25
- 0.0.9 — 2017-07-24
- 0.0.8 — 2017-07-23
- 0.0.6 — 2017-07-19
- 0.0.4 — 2017-07-19
- 0.0.3 — 2017-07-19
- 0.0.2 — 2017-07-19
- 0.0.1 — 2017-07-19
- 1.0.0 — 2017-07-19

## README

<!-- TITLE/ -->

<h1>thelogic</h1>

<!-- /TITLE -->


<!-- BADGES/ -->

<span class="badge-npmversion"><a href="https://npmjs.org/package/thelogic" title="View this project on NPM"><img src="https://img.shields.io/npm/v/thelogic.svg" alt="NPM version" /></a></span>
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/thelogic" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/thelogic.svg" alt="NPM downloads" /></a></span>

<!-- /BADGES -->


<!-- DESCRIPTION/ -->

A Logic Engine written in TypeScript

<!-- /DESCRIPTION -->


<!-- HISTORY/ -->

<h2>History</h2>

<a href="https://github.com/magnostherobot/thelogic/releases">Discover the release history by heading on over to the releases page.</a>

<!-- /HISTORY -->


# WARNING: CURRENTLY IN DEVELOPMENT!
## To Use:
1. Install (_npm_ required):
```bash
npm install thelogic
```
2. Import:
```typescript
import { default as L } from 'thelogic';
```
3. Logic away:
```typescript
let a = new L.Statement();
let b = new L.Statement();
let impl = new L.BinaryOperator((v) => {return (!v[0]) || v[1];});
let exp = new L.Expression([new L.Atom(a), new L.Atom(b)], impl);
let env = new L.Environment([[a, true], [b, false]]);
exp.value(env); // true
```
Manual coming soon (maybe).

## To Help Develop:
Currently a private repo.
1. Clone the repository (_git_ required):
```bash
cd MY_PROJECTS
git clone https://github.com/trharley/thelogic.git
```
2. Install dependencies and development-dependencies (_npm_ required):
```bash
cd thelogic/
npm install
```
- Tests are run:
```bash
npm test
```
- To transpile the TS into JS (not necessary for testing):
```bash
npm run-script buildjs
```
the output goes into `build/`.
- To generate documentation:
```bash
npm run-script builddocs
```

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