Skip to content

Commit

Permalink
docs(Readme): update usage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mihailpozarski committed Sep 7, 2022
1 parent 158ae8d commit 483ef8b
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install chilean-rutify
```

## Usage
You can use the available utility methods by importing the `ChileanRutify` class instance:
You can use the available utility methods by importing the default object:

```js
import ChileanRutify from 'chilean-rutify';
Expand All @@ -36,6 +36,36 @@ ChileanRutify.getRutVerifier(rut)
// "8"
```

or destructure each individual utility method:

```js
import {
validRutValue,
validRutValues,
getRutVerifier,
validRutVerifier,
normalizeRut,
formatRut,
validRut
} from "chilean-rutify";

// using an example rut '36.408.368-8'
let rut = '36408368-8';
normalizeRut(rut);
// 364083688
formatRut(rut);
// "36.408.368-8"
validRut(rut);
// true
validRutVerifier(rut)
// true
validRutValues(rut)
// true
rut = '36408368';
getRutVerifier(rut)
// "8"
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mihailpozarski/chilean-rutify-js. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/mihailpozarski/chilean-rutify-js/blob/main/CODE_OF_CONDUCT.md).
Expand Down

0 comments on commit 483ef8b

Please sign in to comment.