Skip to content

Commit

Permalink
export types
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Dec 17, 2022
1 parent 1a10639 commit 9fcb29e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ coverage
*.ts
*.json
.editorconfig
deno.lock
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runme list

### Deno

You can import the module directly from the Deno module hosting service via `https://deno.land/x/runme@0.2.3/mod.ts`.
You can import the module directly from the Deno module hosting service via `https://deno.land/x/runme@0.4.1/mod.ts`.

## Usage

Expand All @@ -40,15 +40,32 @@ Parse markdown into AST:
```ts
import { parse } from 'runme'
// or when using Deno:
// import { parse } from 'https://deno.land/x/runme@0.2.3/mod.ts'

console.log(await parse('## Hello World\n'))
// import { parse } from 'https://deno.land/x/runme@0.4.1/mod.ts'

console.log(await parse(
'## Hello World\n' +
'```sh\n' +
'echo "Hello World"\n'
'```'
))
/**
* outputs:
* [{ markdown: '## Hello World' }]
* [{
* kind: 1,
* languageId: "",
* value: "# Hello World",
* }, {
* kind: 2,
* languageId: "sh",
* metadata: {
* "runme.dev/name": "echo-hello",
* },
* value: 'echo "Hello World"',
* }]
*/
```

---

<p align="center"><small>Copyright 2022 © <a href="http://stateful.com/">Stateful</a> – Apache 2.0 License</small></p>
'# Hello World\n```sh\n```'),
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
Expand Down

0 comments on commit 9fcb29e

Please sign in to comment.