Skip to content

Commit

Permalink
Add replace example
Browse files Browse the repository at this point in the history
  • Loading branch information
julkue committed Feb 13, 2018
1 parent be5ee5b commit e58a151
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,20 @@ An object of options:
| placeholder | string | '// <% diacritics %>' | The placeholder that will be replaced with an array of equivalent diacritics and their mappings |
| type | string | 'const' | The variable type |
| name | string | 'diacritics' | The variable name |

**Example**:

```javascript
const Diacritic = require('diacritics-transliterator');

const testString = `
const x = "Diacritics will be inserted below";
// <% diacritics %>
`;

Diacritic.replace(testString).then(response => {
console.log(response);
}, msg => {
throw new Error(`Failed: ${msg}`);
});
```

0 comments on commit e58a151

Please sign in to comment.