Skip to content

Commit

Permalink
Merge pull request #15 from DysphoricUnicorn/add-usage-example-to-readme
Browse files Browse the repository at this point in the history
Add usage example to README
  • Loading branch information
tonyketcham authored Apr 12, 2023
2 parents 64ef20c + 97bbb88 commit d21e828
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ export default {
};
```

Then you can simply import yaml files like you would any other file:

```ts
import YamlContent from './your.yaml';

console.log(YamlContent.example);
```

Do note that you may have to include the file type in your import.

### 🔦 TypeScript support

The recommended way to add type definitions for `.yaml` or `.yml` modules is via a `tsconfig.json` file.
Expand Down

0 comments on commit d21e828

Please sign in to comment.