Skip to content

Commit 0ee7ab1

Browse files
authored
docs: Explain TypeScript Support
1 parent ad87d7e commit 0ee7ab1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,21 @@ var q = new Queue(function (input, cb) {
660660
)
661661
```
662662

663-
### Typescript support
663+
### TypeScript Support
664664

665+
Better Queue can be used in TypeScript projects by installing type definitions from the [Definitely Typed](https://github.com/DefinitelyTyped/DefinitelyTyped) repository:
665666

667+
```bash
668+
npm install --save @types/better-queue
669+
```
670+
671+
Afterwards, you can simply import the library:
672+
673+
```ts
674+
import Queue = require('better-queue')
675+
676+
const q: Queue = new Queue(() => {});
677+
```
666678

667679

668680
[back to top](#table-of-contents)

0 commit comments

Comments
 (0)