Skip to content

Commit

Permalink
Fix running bin through npx
Browse files Browse the repository at this point in the history
  • Loading branch information
hjagodzinski committed Dec 17, 2024
1 parent cce151f commit f046dbe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ npm run test
```shell
npm run lint
```

### Building

```shell
npm run build
```
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ const items = convertDescriptionToItems(description, { parseToDOM });
console.log(JSON.stringify(items));
```

> [!CAUTION]
> Any option to `convertDescriptionToItems` that is not mentioned in the documentation is subject to change. If you
> need anything more than the listed options, ask a question by opening an issue or contribute by creating a pull
> request.
### CLI

```shell
$ echo "<p>Hello World</p>" | convert-description
$ echo "<p>Hello World</p>" | npx @allegro/convert-description
[{"type":"TEXT","content":"<p>Hello World</p>"}]
```

> [!CAUTION]
> Any option to `convertDescriptionToItems` that is not mentioned in the documentation is subject to change. If you
> need anything more than the listed options, ask a question by opening an issue or contribute by creating a pull
> request.
[Allegro Rest API]: https://developer.allegro.pl/tutorials/list-offer-assigned-product-one-request-D7Kj9M71Bu6
[DOM API]: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model
[jsdom]: https://github.com/jsdom/jsdom
1 change: 1 addition & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const convertDescription = (inputStream, outputStream) => {
outputStream.write(
JSON.stringify(convertDescriptionToItems(inputData, { parseToDOM })),
);
outputStream.write("\n");
});
};

Expand Down

0 comments on commit f046dbe

Please sign in to comment.