diff --git a/.gitignore b/.gitignore index 97bfbfa..356b4d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /node_modules *.log -/build \ No newline at end of file +/build diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..5a3d649 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +/test +.eslintrc.json +.gitignore +yarn.lock \ No newline at end of file diff --git a/README.md b/README.md index 3ceef7f..4b33c48 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # The sveltedoc parser -## Key Features +Generate a JSON documentation for a Svelte file + +[![npm](https://img.shields.io/npm/v/sveltedoc-parser.svg)](https://www.npmjs.com/package/sveltedoc-parser) + +## Install + +```shell +npm install --save sveltedoc-parser +``` + +## Features - JSDoc support - Extract the component description from JSDoc @@ -22,10 +32,27 @@ |---------|-----------|---------------| | **filename** | The filename to parse. **Required**, unless `fileContent` is passed. | | | **fileContent** | The file content to parse. **Required**, unless `filename` is passed. | | -| **encoding** | The file encoding. | 'utf8' | +| **encoding** | The file encoding. | `utf8` | | **features** | The component features to parse and extracting. | By default used all supported features. | | **ignoredVisibilities** | The list of ignored visibilities. | `['private', 'protected']` | +## Usage + +```js +const sveltedoc = require('sveltedoc-parser'); +const options = { + filename: 'main.svelte' +}; + +sveltedoc.parse(options) + .then(componentDoc => { + console.log(componentDoc); + }) + .catch(e => { + console.error(e); + }); +``` + ## Issues All list of known issues presented at [this page](https://github.com/alexprey/sveltedoc-parser/issues). diff --git a/package.json b/package.json index 0f070f4..d6892e6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@sveltedoc/parser", + "name": "sveltedoc-parser", "version": "1.0.0", "description": "Generate a JSON documentation for a Svelte file", "main": "index.js", diff --git a/test/events/event.method.fire.identifier.svelte b/test/events/event.method.fire.identifier.svelte new file mode 100644 index 0000000..56e37a5 --- /dev/null +++ b/test/events/event.method.fire.identifier.svelte @@ -0,0 +1,23 @@ +