Skip to content

Commit

Permalink
Readme: update imports to more modern style
Browse files Browse the repository at this point in the history
  • Loading branch information
stscoundrel authored Sep 28, 2024
1 parent 78d2de1 commit 49d183f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Also available for [Rust](https://github.com/stscoundrel/harlaw-rs)

### Install

`yarn add harlaw`
`npm install harlaw`

### Usage


With default settings:

```javascript
const { toJson } = require('harlaw');
import { toJson } from 'harlaw';

const input = `${__dirname}/dsl/myDictionary.dsl`
const output = `${__dirname}/json/myResult.json`
Expand All @@ -29,7 +29,7 @@ By default, Harlaw performs HTML transform to Lingvo markup. For example, `[b]`
You can also pass on settings array to remove all extra markup:

```javascript
const { toJson, noMarkupSettings } = require('harlaw');
import { toJson, noMarkupSettings } from 'harlaw'

const input = `${__dirname}/dsl/myDictionary.dsl`
const output = `${__dirname}/json/myResult.json`
Expand All @@ -41,7 +41,7 @@ await toJson(input, output, noMarkupSettings)
For custom formatting needs, you can also pass on completely custom settings object:

```javascript
const { toJson } = require('harlaw');
import { toJson } from 'harlaw';

const input = `${__dirname}/dsl/myDictionary.dsl`
const output = `${__dirname}/json/myResult.json`
Expand Down Expand Up @@ -71,7 +71,7 @@ await toJson(input, output, mySettings)
If you don't want physical json file, but would rather just do something with data, use `toArray`

```javascript
const { toArray } = require('harlaw');
import { toArray } from 'harlaw';

const input = `${__dirname}/dsl/myDictionary.dsl`

Expand All @@ -93,7 +93,7 @@ You can use custom read options by passing readOptions object to settings. It wi


```javascript
const { toJson, toArray } = require('harlaw');
import { toJson, toArray } from 'harlaw';

const input = `${__dirname}/dsl/myDictionary.dsl`
const output = `${__dirname}/json/myResult.json`
Expand Down

0 comments on commit 49d183f

Please sign in to comment.