Skip to content

Commit

Permalink
README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorris committed Aug 25, 2024
1 parent e10da78 commit 05eb1b5
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,44 @@

[![Test](https://github.com/seanmorris/libtuple/actions/workflows/test.yaml/badge.svg)](https://github.com/seanmorris/libtuple/actions/workflows/test.yaml)

### Install with NPM
### Install & Use

`libtuple` is now ESM compliant!

#### npm:

You can install libtuple via `npm`:

```bash
$ npm install libtuple
```

## Usage
You can also import directly via [importmaps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap):

`libtuple` is now ESM compliant!
```html
<script type="importmap">
{
"imports": {
"libtuple": "https://cdn.jsdelivr.net/npm/libtuple/index.mjs"
}
}
</script>
```

#### Usage

Simply import the functions from `libtuple`:

```javascript
import { Tuple, Group, Record, Dict } from 'libtuple';
```

You can also import them via [dynamic imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import):

```javascript
const { Tuple, Group, Record, Dict } = await import('https://cdn.jsdelivr.net/npm/libtuple/index.mjs');
```

### Tuple()

Pass a list of values to the `Tuple()` function. This value will be strictly equivalent to any tuple generated with the same values:
Expand Down

0 comments on commit 05eb1b5

Please sign in to comment.