bonsai-js 0.1.0 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +15 -4
  2. package/package.json +11 -6
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
- # bonsai-js
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/danfry1/bonsai-js/main/website/logo.png" alt="bonsai-js" width="120" />
3
+ </p>
2
4
 
3
- Safe expression evaluation for rules, filters, templates, and user-authored logic in JavaScript and TypeScript.
5
+ <h1 align="center">bonsai-js</h1>
6
+
7
+ [![npm version](https://img.shields.io/npm/v/bonsai-js)](https://www.npmjs.com/package/bonsai-js)
8
+ [![npm downloads](https://img.shields.io/npm/dm/bonsai-js)](https://www.npmjs.com/package/bonsai-js)
9
+ [![CI](https://github.com/danfry1/bonsai-js/actions/workflows/ci.yml/badge.svg)](https://github.com/danfry1/bonsai-js/actions/workflows/ci.yml)
10
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/bonsai-js)](https://bundlephobia.com/package/bonsai-js)
11
+ [![zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://www.npmjs.com/package/bonsai-js)
12
+ [![license](https://img.shields.io/npm/l/bonsai-js)](https://github.com/danfry1/bonsai-js/blob/main/LICENSE)
13
+
14
+ A safe expression language for rules, filters, templates, and user-authored logic. Runs in any JavaScript runtime.
4
15
 
5
16
  Bonsai gives you a constrained expression language with caching, typed errors, pluggable transforms/functions, and safety controls. It is designed for cases where `eval()` would be inappropriate: business rules, formula fields, admin-defined filters, template helpers, and product configuration.
6
17
 
@@ -467,8 +478,8 @@ Benchmark guidance and current numbers live in the website docs and benchmark su
467
478
 
468
479
  Bonsai follows SemVer for the documented package entrypoints `bonsai-js` and `bonsai-js/stdlib`.
469
480
 
470
- - Supported runtimes are Node 18+ and current Bun releases.
471
- - The packed npm artifact is smoke-tested on Node 18, 20, and 22.
481
+ - Supported runtimes are Node 20+ and current Bun releases.
482
+ - The packed npm artifact is smoke-tested on Node 20 and 22.
472
483
  - Internal modules under `src/*` are not public API.
473
484
 
474
485
  See [stability policy](./docs/stability-policy.md) for the compatibility boundary and release rules.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bonsai-js",
3
- "version": "0.1.0",
4
- "description": "A modern, high-performance expression evaluator for JavaScript",
3
+ "version": "0.1.2",
4
+ "description": "A safe, zero-dependency expression language for rules, filters, and templates",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.mjs",
@@ -26,10 +26,12 @@
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/danfry1/bonsai-js"
29
+ "url": "git+https://github.com/danfry1/bonsai-js.git"
30
+ },
31
+ "homepage": "https://danfry1.github.io/bonsai-js/",
32
+ "bugs": {
33
+ "url": "https://github.com/danfry1/bonsai-js/issues"
30
34
  },
31
- "homepage": "https://github.com/danfry1/bonsai-js#readme",
32
- "bugs": "https://github.com/danfry1/bonsai-js/issues",
33
35
  "scripts": {
34
36
  "build": "tsdown",
35
37
  "test": "vitest run",
@@ -40,16 +42,19 @@
40
42
  "lint": "oxlint --deny-warnings src tests scripts",
41
43
  "typecheck": "tsc -p tsconfig.typecheck.json --noEmit",
42
44
  "build:website": "bun website/build.ts",
45
+ "prepare": "test -n \"$CI\" || lefthook install",
43
46
  "prepublishOnly": "bun run lint && bun run typecheck && bun run test && bun run bench:gate && bun run check:package"
44
47
  },
45
48
  "keywords": ["expression", "evaluator", "parser", "safe", "sandbox", "template", "pipe", "transform", "formula", "dsl", "ast", "jexl", "compiler"],
46
49
  "author": "Daniel Fry",
47
50
  "license": "MIT",
48
51
  "engines": {
49
- "node": ">=18"
52
+ "node": ">=20"
50
53
  },
51
54
  "devDependencies": {
55
+ "@types/node": "^25.4.0",
52
56
  "jexl": "^2.3.0",
57
+ "lefthook": "^2.1.3",
53
58
  "oxlint": "^1.51.0",
54
59
  "tsdown": "^0.21.0",
55
60
  "typescript": "^5.9.3",