# jsroot

> JavaScript ROOT

Latest version **7.11.1** (published 2026-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsroot
pnpm add jsroot
yarn add jsroot
bun add jsroot
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; large bundle.

## Facts

| | |
|---|---|
| Version | 7.11.1 |
| Published | 2026-07-27 |
| First published | 2017-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 0.18.0 |
| Dependencies | 8 |
| Unpacked size | 25.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 215 |
| Author | linev |
| Maintainers | linev |
| Keywords | ROOT, interactive, svg, webgl, THttpServer |

## Links

- npm: https://www.npmjs.com/package/jsroot
- Repository: https://github.com/root-project/jsroot
- Homepage: https://root.cern/js/
- Issues: https://github.com/root-project/jsroot/issues
- npm.io page: https://npm.io/package/jsroot

## Dependencies (8)

- [tmp](https://npm.io/package/tmp.md) ^0.2.5
- [xhr2](https://npm.io/package/xhr2.md) ^0.2.1
- [jsdom](https://npm.io/package/jsdom.md) ^29.0.2
- [three](https://npm.io/package/three.md) 0.162.0
- [canvas](https://npm.io/package/canvas.md) ^3.2.2
- [mathjax](https://npm.io/package/mathjax.md) 3.2.2
- [@resvg/resvg-js](https://npm.io/package/@resvg/resvg-js.md) ^2.6.2
- [@oneidentity/zstd-js](https://npm.io/package/@oneidentity/zstd-js.md) ^1.0.3

## Recent versions

- 7.11.1 (latest) — 2026-07-27
- 7.11.0 — 2026-05-05
- 7.10.3 — 2026-02-26
- 7.10.2 — 2026-02-11
- 7.10.1 — 2025-11-26
- 7.10.0 — 2025-10-27
- 7.9.3 — 2025-10-21
- 7.9.2 — 2025-10-13
- 7.9.1 — 2025-05-19
- 7.9.0 — 2025-04-25
- 7.8.2 — 2025-03-26
- 7.7.6 — 2025-03-26
- 7.8.1 — 2025-01-22
- 7.8.0 — 2024-11-11
- 7.7.5 — 2024-10-31
- … 72 more at https://npm.io/package/jsroot/versions

## README

# JavaScript ROOT

JavaScript ROOT provides interactive ROOT-like graphics in the web browsers and in `node.js`.
Data can be read and displayed from ROOT binary and JSON files.
`JSROOT` implements user interface for THttpServer class.

## Examples

[![Color draw for TH2](https://root.cern/js/files/img/th2.png)](https://root.cern/js/latest/?nobrowser&file=https://root.cern/js/files/hsimple.root&item=hpxpy;1&opt=colz)   [![2-dimensional TTree::Draw with cut options](https://root.cern/js/files/img/ttree.png)](https://root.cern/js/latest/?nobrowser&file=https://root.cern/js/files/hsimple.root&item=ntuple;1&opt=px:py::pz%3E4)    [![Several variants of THStack drawing](https://root.cern/js/files/img/thstack.png)](https://root.cern/js/latest/?nobrowser&file=https://root.cern/js/files/histpainter6.root&item=draw_hstack;1)   [![Drawing of TGeo model superimposed with tracks and hits](https://root.cern/js/files/img/geo_tracks.png)](https://root.cern/js/latest/?nobrowser&json=https://root.cern/js/files/geom/simple_alice.json.gz&file=https://root.cern/js/files/geom/tracks_hits.root&item=simple_alice.json.gz+tracks_hits.root/tracks;1+tracks_hits.root/hits;1)


### In web browser
```javascript
...
   <body>
      <div id="drawing" style="position: relative; width: 800px; height: 600px;"></div>
   </body>
   <script type='module'>
      import { openFile, draw } from 'https://root.cern/js/latest/modules/main.mjs';
      let file = await openFile('https://root.cern/js/files/hsimple.root');
      let obj = await file.readObject('hpxpy;1');
      draw('drawing', obj, 'colz');
   </script>
...
```

### In node.js
```javascript
import { openFile, makeSVG } from 'jsroot';
import { writeFileSync } from 'fs';
let file = await openFile('https://root.cern/js/files/hsimple.root');
let obj = await file.readObject('hpxpy;1');
let svg = await makeSVG({ object: obj, option: 'lego2,pal50', width: 800, height: 600 });
writeFileSync('lego2.svg', svg);
```

### More examples
[Supported classes/options](https://root.cern/js/latest/examples.htm)

[API examples](https://root.cern/js/latest/api.htm)


## Install
```
npm install jsroot
```
For 3D rendering jsroot uses [gl](https://www.npmjs.com/package/gl) package which may have problems
during installation. To use jsroot without `gl` one can omit development packages:
```
npm install jsroot --omit=dev
```


## Documentation
[Tutorial](docs/JSROOT.md)

[THttpServer](docs/HttpServer.md)

[Changelog](changes.md)

[Reference API](https://root.cern/js/latest/jsdoc/global.html)

## Links
[https://root.cern/js/](https://root.cern/js/)

[https://jsroot.gsi.de](https://jsroot.gsi.de/)

---
_Source: https://npm.io/package/jsroot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
