You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CODE_OF_CONDUCT.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,21 @@ Our Standards
14
14
Examples of behavior that contributes to creating a positive environment
15
15
include:
16
16
17
-
* Using welcoming and inclusive language
18
-
* Being respectful of differing viewpoints and experiences
19
-
* Gracefully accepting constructive criticism
20
-
* Focusing on what is best for the community
21
-
* Showing empathy towards other community members
17
+
- Using welcoming and inclusive language
18
+
- Being respectful of differing viewpoints and experiences
19
+
- Gracefully accepting constructive criticism
20
+
- Focusing on what is best for the community
21
+
- Showing empathy towards other community members
22
22
23
23
Examples of unacceptable behavior by participants include:
24
24
25
-
* The use of sexualized language or imagery and unwelcome sexual attention or
26
-
advances
27
-
* Trolling, insulting/derogatory comments, and personal or political attacks
28
-
* Public or private harassment
29
-
* Publishing others' private information, such as a physical or electronic
25
+
- The use of sexualized language or imagery and unwelcome sexual attention or
26
+
advances
27
+
- Trolling, insulting/derogatory comments, and personal or political attacks
28
+
- Public or private harassment
29
+
- Publishing others' private information, such as a physical or electronic
30
30
address, without explicit permission
31
-
* Other conduct which could reasonably be considered inappropriate in a
31
+
- Other conduct which could reasonably be considered inappropriate in a
32
32
professional setting
33
33
34
34
Our Responsibilities
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
Enforcement
56
56
57
57
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
-
reported by contacting any of the code of conduct enforcers: [Frederik Wessberg](mailto:[email protected]).
58
+
reported by contacting any of the code of conduct enforcers: [Frederik Wessberg](mailto:[email protected]) ([@FredWessberg](https://twitter.com/FredWessberg)) ([Website](https://github.com/wessberg)).
59
59
All complaints will be reviewed and investigated and will result in a response that
60
60
is deemed necessary and appropriate to the circumstances. The project team is
61
61
obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -68,4 +68,4 @@ members of the project's leadership.
68
68
Attribution
69
69
70
70
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
71
-
available at http://contributor-covenant.org/version/1/4/
71
+
available at http://contributor-covenant.org/version/1/4/
<imgalt="Logo for @wessberg/ts-evaluator"src="https://raw.githubusercontent.com/wessberg/ts-evaluator/master/documentation/asset/ts-evaluator-logo.png"height="120"></img><br>
2
-
<ahref="https://npmcharts.com/compare/@wessberg/ts-evaluator?minimal=true"><imgalt="Downloads per month"src="https://img.shields.io/npm/dm/%40wessberg%2Fts-evaluator.svg"height="20"></img></a>
<ahref="https://www.patreon.com/bePatron?u=11315442"><imgalt="Support on Patreon"src="https://c5.patreon.com/external/logo/[email protected]"height="20"></img></a>
> An interpreter for Typescript that can evaluate an arbitrary Node within a Typescript AST
10
10
11
+
<!-- SHADOW_SECTION_DESCRIPTION_SHORT_END -->
12
+
13
+
<!-- SHADOW_SECTION_BADGES_START -->
14
+
15
+
<ahref="https://npmcharts.com/compare/%40wessberg%2Fts-evaluator?minimal=true"><imgalt="Downloads per month"src="https://img.shields.io/npm/dm/%40wessberg%2Fts-evaluator.svg" /></a>
<ahref="https://www.patreon.com/bePatron?u=11315442"><imgalt="Support on Patreon"src="https://img.shields.io/badge/patreon-donate-green.svg" /></a>
22
+
23
+
<!-- SHADOW_SECTION_BADGES_END -->
24
+
25
+
<!-- SHADOW_SECTION_DESCRIPTION_LONG_START -->
26
+
11
27
## Description
12
28
29
+
<!-- SHADOW_SECTION_DESCRIPTION_LONG_END -->
30
+
13
31
This library is an implementation of an interpreter for Typescript that can evaluate any `Expression`, `ExpressionStatement` or `Declaration` within a Typescript AST.
14
32
Rather than interpreting a _program_, or a sequence of `Statement`s, this library takes a Node within an existing AST and evaluates it based on its' lexical environment.
15
33
@@ -24,6 +42,44 @@ Additionally, `ts-evaluator` supports both a Browser environment, a Node environ
24
42
25
43
If you are looking for a Typescript REPL, or a way to _execute_ a full Typescript program, you're looking for something like [ts-node](https://github.com/TypeStrong/ts-node) instead.
26
44
45
+
<!-- SHADOW_SECTION_FEATURES_START -->
46
+
47
+
### Features
48
+
49
+
<!-- SHADOW_SECTION_FEATURES_END -->
50
+
51
+
- Evaluate _any_ Node within a Typescript AST and get an actual value back
52
+
- Supports browser-, node, and ECMA environments.
53
+
- Supports several reporting- and diagnostic hooks you can use use
@@ -178,18 +240,52 @@ Here's an explainer of the different reporting hooks:
178
240
-`reportIntermediateResults(entry: IIntermediateResultReportEntry) => void|(Promise<void>)` - Will be invoked for each intermediate result that has been evaluated before producing a final result. This allows you to work programmatically with all expression values during code execution.
179
241
-`reportErrors(entry: IErrorReportEntry) => void|(Promise<void>)` - Will be invoked for each error that is thrown, both when evaluating a result, and for subsequent invocations on, for example, returned function instances. Holds a reference to the error, as well ast the AST node that threw or caused the Error.
180
242
243
+
<!-- SHADOW_SECTION_CONTRIBUTING_START -->
244
+
181
245
## Contributing
182
246
183
247
Do you want to contribute? Awesome! Please follow [these recommendations](./CONTRIBUTING.md).
[Become a backer](https://www.patreon.com/bePatron?u=11315442) and get your name, avatar, and Twitter handle listed here.
268
+
269
+
<ahref="https://www.patreon.com/bePatron?u=11315442"><imgalt="Backers on Patreon"src="https://patreon-badge.herokuapp.com/11315442.png"width="500" /></a>
270
+
271
+
<!-- SHADOW_SECTION_BACKERS_END -->
272
+
273
+
<!-- SHADOW_SECTION_FAQ_START -->
274
+
275
+
## FAQ
276
+
277
+
<!-- SHADOW_SECTION_FAQ_END -->
278
+
279
+
### How fast is this?
280
+
281
+
This is, after all, a virtual machine written on top of another virtual machine (V8), which is built in a dynamically typed high-level language (EcmaScript). This library is _not_ built to be
282
+
comparable in performance to raw V8 execution speed. However, since `ts-evaluator` doesn't require a compile-step and works directly on an AST, for small operations it will most likely be several magnitudes faster than
283
+
both `ts-node` and compiling to JavaScript with `tsc` and executing directly.
188
284
189
-
## Backers 🏅
285
+
<!-- SHADOW_SECTION_LICENSE_START -->
190
286
191
-
[Become a backer](https://www.patreon.com/bePatron?u=11315442) and get your name, logo, and link to your site listed here.
0 commit comments