Skip to content

Commit

Permalink
0.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Mar 6, 2019
1 parent ee68457 commit 99b257d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 38 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,12 @@
## [0.0.19](https://github.com/wessberg/ts-evaluator/compare/v0.0.18...v0.0.19) (2019-03-06)


### Bug Fixes

* **bug:** fixes an issue with ArrayLiteralExpressions and iterables. ([41c6452](https://github.com/wessberg/ts-evaluator/commit/41c6452))



## [0.0.18](https://github.com/wessberg/ts-evaluator/compare/v0.0.17...v0.0.18) (2018-12-30)


Expand Down
79 changes: 42 additions & 37 deletions README.md
Expand Up @@ -69,11 +69,16 @@ If you are looking for a Typescript REPL, or a way to _execute_ a full Typescrip
- [NPM](#npm)
- [Yarn](#yarn)
- [Usage](#usage)
- [Setting up an environment](#setting-up-an-environment)
- [Setting up Policies](#setting-up-policies)
- [Logging](#logging)
- [Reporting](#reporting)
- [Contributing](#contributing)
- [Maintainers](#maintainers)
- [Backers](#backers)
- [Patreon](#patreon)
- [FAQ](#faq)
- [How fast is this?](#how-fast-is-this)
- [License](#license)

<!-- SHADOW_SECTION_TOC_END -->
Expand Down Expand Up @@ -108,18 +113,18 @@ Let's start off with a very basic example:
import {evaluate} from "@wessberg/ts-evaluator";

const result = evaluate({
node: someNode,
typeChecker: someTypeChecker
node: someNode,
typeChecker: someTypeChecker
});

// If a value was produced
if (result.success) {
console.log(result.value);
console.log(result.value);
}

// If an error occurred
else {
console.log(result.reason);
console.log(result.reason);
}
```

Expand All @@ -141,14 +146,14 @@ Here's how you can configure environment options:

```typescript
const result = evaluate({
// ...
environment: {
// The "Node" environment is the default one. You can simply omit this key if you are targeting a Node environment
preset: EnvironmentPresetKind.NODE,
extra: {
someGlobal: "someValue"
}
}
// ...
environment: {
// The "Node" environment is the default one. You can simply omit this key if you are targeting a Node environment
preset: EnvironmentPresetKind.NODE,
extra: {
someGlobal: "someValue"
}
}
});
```

Expand All @@ -161,22 +166,22 @@ By default, IO writes, network calls, and spawning child processes are restricte

```typescript
const result = evaluate({
// ...
policy: {
deterministic: false,
network: false,
console: false,
maxOps: Infinity,
maxOpDuration: Infinity,
io: {
read: true,
write: false
},
process: {
exit: false,
spawnChild: false
}
}
// ...
policy: {
deterministic: false,
network: false,
console: false,
maxOps: Infinity,
maxOpDuration: Infinity,
io: {
read: true,
write: false
},
process: {
exit: false,
spawnChild: false
}
}
});
```

Expand Down Expand Up @@ -204,8 +209,8 @@ You can get information about the evaluation process with various levels of logg

```typescript
const result = evaluate({
// ...
logLevel: LogLevelKind.DEBUG
// ...
logLevel: LogLevelKind.DEBUG
});
```

Expand All @@ -223,13 +228,13 @@ These are useful if you want to understand more about the execution path and wor

```typescript
const result = evaluate({
// ...
reporting: {
reportBindings: entry => doSomething(entry),
reportTraversal: entry => someArray.push(entry.node),
reportIntermediateResults: entry => doSomeOtherThing(entry),
reportErrors: entry => doSomethingWithError(entry)
}
// ...
reporting: {
reportBindings: entry => doSomething(entry),
reportTraversal: entry => someArray.push(entry.node),
reportIntermediateResults: entry => doSomeOtherThing(entry),
reportErrors: entry => doSomethingWithError(entry)
}
});
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@wessberg/ts-evaluator",
"version": "0.0.18",
"version": "0.0.19",
"description": "An interpreter for Typescript that can evaluate an arbitrary Node within a Typescript AST",
"scripts": {
"generate:readme": "scaffold readme --yes",
Expand Down

0 comments on commit 99b257d

Please sign in to comment.