Skip to content

Commit

Permalink
Update README.md to include ESM information
Browse files Browse the repository at this point in the history
  • Loading branch information
mesaugat committed Jul 14, 2024
1 parent 2782db6 commit 5b04f32
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,37 @@ Exclude keys to compare from a deep equal operation with chai [expect](http://ch

## Why?

Sometimes you'll need to exclude object properties that generate unique values while doing a deep equal operation. This plugin makes it easier to remove those properties from comparison.
Sometimes you'll need to exclude object properties that generate unique values while doing an assertion. This plugin makes it easier to remove those properties from comparison.

Works with both objects and array of objects with or without circular references.

## Installation

```bash
npm install chai-exclude --save-dev
```
`chai-exclude` is an ESM package targeting Chai v5 and above.

```bash
yarn add chai-exclude --dev
npm install chai-exclude --save-dev
```

## Usage
If you are using Chai v4, you can use the CommonJS version of the package.

### ES6 Import
```
npm install chai-exclude@2.1.1 --save-dev
```

```js
import chai from 'chai';
import chaiExclude from 'chai-exclude';
```bash

chai.use(chaiExclude);
```
```bash
### TypeScript
## Usage
```js
import * as chai from 'chai';
import chai from 'chai';
import chaiExclude from 'chai-exclude';

chai.use(chaiExclude);

// The typings for chai-exclude are included with the package itself.
// If you are using TypeScript, the typings for chai-exclude are included with the package itself.
```

## Examples
Expand Down

0 comments on commit 5b04f32

Please sign in to comment.