Skip to content

Commit

Permalink
Update build tooling, add named export, fix dts clashes with ModuleRe…
Browse files Browse the repository at this point in the history
…solution node16

fixes #355
  • Loading branch information
t2t2 committed Aug 11, 2024
1 parent 868c053 commit 0fe4f8c
Show file tree
Hide file tree
Showing 10 changed files with 5,467 additions and 8,350 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
],
parserOptions: {
project: './tsconfig.eslint.json',
extraFileExtensions: ['.cjs'],
},
rules: {
'@typescript-eslint/naming-convention': [
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
node-version: 'latest'
cache: 'npm'
- run: npm ci
- run: npm run test:types
- run: npm run build

lint:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ yarn add obs-websocket-js

### Standalone file / CDN build

Standalone js file is available from [the latest github release](https://github.com/obs-websocket-community-projects/obs-websocket-js/releases) or from jsdeliver & unpkg CDN's:
Standalone js file is available from jsdeliver & unpkg CDN's:

```
https://cdn.jsdelivr.net/npm/obs-websocket-js
Expand All @@ -65,19 +65,19 @@ In addition each version has both modern and legacy builds. Modern bundlers will

### Creating an OBS Websocket client

`OBSWebSocket` is available as the default export in ES Modules:
`OBSWebSocket` is available as a named export in ES Modules:

```ts
import OBSWebSocket from 'obs-websocket-js';
import { OBSWebSocket } from 'obs-websocket-js';

const obs = new OBSWebSocket();
```

When using commonjs `require()` it is available under the `default` object key:
When using commonjs `require()` it is available under the `OBSWebSocket` object key:

```ts
const {default: OBSWebSocket} = require('obs-websocket-js');
const OBSWebSocket = require('obs-websocket-js').default;
const { OBSWebSocket } = require('obs-websocket-js');
const OBSWebSocket = require('obs-websocket-js').OBSWebSocket;

const obs = new OBSWebSocket();
```
Expand Down
Loading

0 comments on commit 0fe4f8c

Please sign in to comment.