aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tsutils/README.md
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/tsutils/README.md
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/tsutils/README.md')
-rw-r--r--node_modules/tsutils/README.md31
1 files changed, 30 insertions, 1 deletions
diff --git a/node_modules/tsutils/README.md b/node_modules/tsutils/README.md
index 785e98609..9dfef9530 100644
--- a/node_modules/tsutils/README.md
+++ b/node_modules/tsutils/README.md
@@ -1,5 +1,7 @@
# Utility functions for working with typescript's AST
+[![Greenkeeper badge](https://badges.greenkeeper.io/ajafff/tsutils.svg)](https://greenkeeper.io/)
+
## Usage
This package consists of two major parts: utilities and typeguard functions.
@@ -29,4 +31,31 @@ import { forEachComment, forEachToken } from "tsutils/util";
This package is backwards compatible with typescript 2.1.0 at runtime although compiling might need a newer version of typescript installed.
-Using `typescript@next` might work, but it's not officially supported. If you encounter any bugs, please open an issue. \ No newline at end of file
+Using `typescript@next` might work, but it's not officially supported. If you encounter any bugs, please open an issue.
+
+For compatibility with older versions of TypeScript typeguard functions are separated by TypeScript version. If you are stuck on `typescript@2.8`, you should import directly from the submodule for that version:
+
+```js
+// all typeguards compatible with typescript@2.8
+import { isIdentifier } from "tsutils/typeguard/2.8";
+// you can even use nested submodules
+import { isIdentifier } from "tsutils/typeguard/2.8/node";
+
+// all typeguards compatible with typescript@2.9 (includes those of 2.8)
+import { isIdentifier } from "tsutils/typeguard/2.9";
+
+// always points to the latest stable version (2.9 as of writing this)
+import { isIdentifier } from "tsutils/typeguard";
+import { isIdentifier } from "tsutils";
+
+// always points to the typeguards for the next TypeScript version (3.0 as of writing this)
+import { isIdentifier } from "tsutils/typeguard/next";
+```
+
+Note that if you are also using utility functions, you should prefer the relevant submodule:
+
+```js
+// importing directly from 'tsutils' would pull in the latest typeguards
+import { forEachToken } from 'tsutils/util';
+import { isIdentifier } from 'tsutils/typeguard/2.8';
+```