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
@@ -54,7 +54,41 @@ const adapter = new MyCustomAdapter();
54
54
constresults=analyzeHead(headNode, adapter);
55
55
```
56
56
57
-
## Validating Your Adapter
57
+
## Node.js usage
58
+
59
+
While capo.js is designed for the browser, you can use it in Node.js by pairing it with a DOM simulation library like [jsdom](https://github.com/jsdom/jsdom).
60
+
61
+
Since jsdom provides a standard DOM API, you can reuse the built-in `BrowserAdapter` instead of writing a custom one:
Some adapters, like those for ESLint, require parent pointers on nodes to support `getParent()` and `getSiblings()`. If your parser doesn't provide these pointers by default (like `@html-eslint/parser`), you must shim them in your test setup.
0 commit comments