diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b283561 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file diff --git a/README.md b/README.md index 4e3c355..89eb97f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,20 @@ class SRT { } ``` +### Readable Stream +A custom readable stream API is also available, example: + +``` +const fs = require('fs'); +const dest = fs.createWriteStream('./output'); +const { SRTReadStream } = require('@eyevinn/srt'); + +const srt = new SRTReadStream('0.0.0.0', 1234); +srt.listen(readStream => { + readStream.pipe(dest); +}); +``` + ## [Contributing](CONTRIBUTING.md) In addition to contributing code, you can help to triage issues. This can include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions.