Skip to content

Commit

Permalink
added in readme and updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
syedhasandigi committed Oct 14, 2024
1 parent 3fca999 commit 5c03bcc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# dtdl-parser
# dtdl-parser

A library for parsing and validating (DTDL)[https://learn.microsoft.com/en-us/azure/digital-twins/concepts-models] ontologies.

## Prerequisites

`node` >= 20
`dotnet` [CLI](https://learn.microsoft.com/en-us/dotnet/core/install/)
Run `dotnet workload install wasm-tools` to install `wasm-tools`

## Getting started

Install dependencies

`npm install`

Build javascript files

`npm run build`

Basic usage

```javascript
import { parseDirectories, validateDirectories} from "dtdl-parser"
import { getInterop } from 'dtdl-parser/src/interop'

const parser = await getInterop()
parseDirectories('../dtdl/simple', parser)
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"test": "NODE_ENV=test ./node_modules/.bin/mocha --config ./test/mocharc.json ./src/**/*.test.ts",
"build": "npx swc ./src ./package.json -d ./build --copy-files",
"build": "swc ./src ./package.json -d ./build --copy-files",
"clean": "rimraf -rf ./build",
"lint": "eslint .",
"depcheck": "depcheck"
Expand Down

0 comments on commit 5c03bcc

Please sign in to comment.