Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jun 27, 2024
1 parent 3457355 commit 1e85bc1
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ that allows you to perform queries like "all items within this bounding box" ver
(e.g. hundreds of times faster than looping over all items).
It's most commonly used in maps and data visualizations.

[![Build Status](https://github.com/mourner/rbush/workflows/Node/badge.svg?branch=main)](https://github.com/mourner/rbush/actions)
[![Node](https://github.com/mourner/rbush/actions/workflows/node.yml/badge.svg)](https://github.com/mourner/rbush/actions/workflows/node.yml)
[![](https://img.shields.io/badge/simply-awesome-brightgreen.svg)](https://github.com/mourner/projects)

## Demos
Expand All @@ -30,14 +30,26 @@ Install with NPM (`npm install rbush`), or use CDN links for browsers:

## Usage

### Importing RBush
### Installing RBush

Install with NPM: `npm install rbush`, then import as a module:

```js
// as a ES module
import RBush from 'rbush';
```

// as a CommonJS module
const RBush = require('rbush');
Or use as a module directly in the browser with [jsDelivr](https://www.jsdelivr.com/esm):

```html
<script type="module">
import RBush from 'https://cdn.jsdelivr.net/npm/rbush/+esm';
</script>
```

Alternatively, there's a browser bundle with an `RBush` global variable:

```html
<script src="https://cdn.jsdelivr.net/npm/rbush"></script>
```

### Creating a Tree
Expand Down Expand Up @@ -216,13 +228,12 @@ bulk-insert 1M items | 1.25s | n/a | 6.7x
## Development

```bash
npm install # install dependencies

npm ci # install dependencies
npm test # lint the code and run tests
npm run perf # run performance benchmarks
npm run cov # report test coverage
```

## Compatibility

RBush should run on Node and all major browsers that support ES5.
RBush v4+ is published as a ES module and no longer supports CommonJS environments. It works universally in modern browsers, but you can transpile the code on your end to support IE11.

0 comments on commit 1e85bc1

Please sign in to comment.