Skip to content

Commit 108bd3c

Browse files
committed
docs: update README for v2
1 parent bc1fa7e commit 108bd3c

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

README.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,25 @@ This package provides an alternative set of type definitions which replaces, and
1414

1515
This package also includes other improved, stricter type definitions.
1616

17-
## Usage
17+
## Installation
1818

19-
### Install
19+
You only need to install `better-typescript-lib`. Additional configuration is not needed; your TypeScript project automatically use `better-typescript-lib` definitions.
2020

2121
```sh
2222
npm i -D better-typescript-lib
2323
```
2424

25-
### Disable built-in library from tsconfig.json
25+
### How it works
2626

27-
```diff
28-
- "lib": ["es5", "dom"]
29-
+ "noLib": true
30-
```
31-
32-
### Include better-typescript-lib
33-
34-
Include better-typescript-lib with triple-slash directives from the entry point of your code. Note that these directives must be placed at the very top of a `.ts` file.
35-
36-
```ts
37-
/// <reference path="./node_modules/better-typescript-lib/lib.es5.d.ts" />
38-
/// <reference path="./node_modules/better-typescript-lib/lib.dom.d.ts" />
39-
```
27+
Starting from TypeScript 4.5, the TypeScript compiler detects existence of `@typescript/xxx` packages (e.g. `@typescript/es2015`) and uses them instead of the built-in definitions. By installing `better-typescript-lib`, these package names are mapped to corresponding `@better-typescript-lib/xxx` packages.
4028

4129
## Supported TypeScript Versions
4230

4331
| better-typescript-lib | TypeScript |
4432
| --------------------- | --------------- |
45-
| 1.2.0 | TS 4.4 or later |
46-
| 1.1.0 | TS 4.2 or later |
47-
| 1.0.0 | TS 4.1 or later |
33+
| 2.0.0 | TS 4.5 or later |
34+
35+
For TS 4.4 and lower, see `v1` branch.
4836

4937
## Concepts
5038

0 commit comments

Comments
 (0)