bonsai-js 0.1.1 → 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 +13 -2
  2. package/package.json +4 -2
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bonsai-js",
3
- "version": "0.1.1",
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",
@@ -42,6 +42,7 @@
42
42
  "lint": "oxlint --deny-warnings src tests scripts",
43
43
  "typecheck": "tsc -p tsconfig.typecheck.json --noEmit",
44
44
  "build:website": "bun website/build.ts",
45
+ "prepare": "test -n \"$CI\" || lefthook install",
45
46
  "prepublishOnly": "bun run lint && bun run typecheck && bun run test && bun run bench:gate && bun run check:package"
46
47
  },
47
48
  "keywords": ["expression", "evaluator", "parser", "safe", "sandbox", "template", "pipe", "transform", "formula", "dsl", "ast", "jexl", "compiler"],
@@ -53,6 +54,7 @@
53
54
  "devDependencies": {
54
55
  "@types/node": "^25.4.0",
55
56
  "jexl": "^2.3.0",
57
+ "lefthook": "^2.1.3",
56
58
  "oxlint": "^1.51.0",
57
59
  "tsdown": "^0.21.0",
58
60
  "typescript": "^5.9.3",