ecma-evaluator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,46 @@
1
+ Copyright (c) 2025 Axetroy
2
+
3
+ "Anti 996" License Version 1.0 (Draft)
4
+
5
+ Permission is hereby granted to any individual or legal entity
6
+ obtaining a copy of this licensed work (including the source code,
7
+ documentation and/or related items, hereinafter collectively referred
8
+ to as the "licensed work"), free of charge, to deal with the licensed
9
+ work for any purpose, including without limitation, the rights to use,
10
+ reproduce, modify, prepare derivative works of, distribute, publish
11
+ and sublicense the licensed work, subject to the following conditions:
12
+
13
+ 1. The individual or the legal entity must conspicuously display,
14
+ without modification, this License and the notice on each redistributed
15
+ or derivative copy of the Licensed Work.
16
+
17
+ 2. The individual or the legal entity must strictly comply with all
18
+ applicable laws, regulations, rules and standards of the jurisdiction
19
+ relating to labor and employment where the individual is physically
20
+ located or where the individual was born or naturalized; or where the
21
+ legal entity is registered or is operating (whichever is stricter). In
22
+ case that the jurisdiction has no such laws, regulations, rules and
23
+ standards or its laws, regulations, rules and standards are
24
+ unenforceable, the individual or the legal entity are required to
25
+ comply with Core International Labor Standards.
26
+
27
+ 3. The individual or the legal entity shall not induce, suggest or force
28
+ its employee(s), whether full-time or part-time, or its independent
29
+ contractor(s), in any methods, to agree in oral or written form, to
30
+ directly or indirectly restrict, weaken or relinquish his or her
31
+ rights or remedies under such laws, regulations, rules and standards
32
+ relating to labor and employment as mentioned above, no matter whether
33
+ such written or oral agreements are enforceable under the laws of the
34
+ said jurisdiction, nor shall such individual or the legal entity
35
+ limit, in any methods, the rights of its employee(s) or independent
36
+ contractor(s) from reporting or complaining to the copyright holder or
37
+ relevant authorities monitoring the compliance of the license about
38
+ its violation(s) of the said license.
39
+
40
+ THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
44
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
45
+ OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE
46
+ LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # ecma-evaluator
2
+
3
+ [![Badge](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg?style=flat-square)](https://996.icu/#/en_US)
4
+ [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=flat-square)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
5
+ ![Node](https://img.shields.io/badge/node-%3E=14-blue.svg?style=flat-square)
6
+ [![npm version](https://badge.fury.io/js/ecma-evaluator.svg)](https://badge.fury.io/js/ecma-evaluator)
7
+
8
+ A tiny and fast JavaScript expression evaluator.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install ecma-evaluator --save
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ ```js
19
+ import { evaluatorExpression, evaluatorTemplate } from "ecma-evaluator";
20
+
21
+ // Evaluate expression
22
+ const expr = "a + b * c";
23
+ const context = { a: 1, b: 2, c: 3 };
24
+ const result = evaluatorExpression(expr, context);
25
+ console.log(result); // Output: 7
26
+
27
+ // Evaluate template
28
+ const template = "The result of {{ a }} + {{ b }} * {{ c }} is {{ a + b * c }}.";
29
+ const templateResult = evaluatorTemplate(template, context);
30
+ console.log(templateResult); // Output: "The result of 1 + 2 * 3 is 7."
31
+ ```
32
+
33
+ ## License
34
+
35
+ The [Anti 996 License](LICENSE)