summaryrefslogtreecommitdiff
path: root/docs/standard_library.md
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2020-07-31 11:12:20 +0200
committerGitHub <noreply@github.com>2020-07-31 11:12:20 +0200
commit4afb4b6e46de2ed536a3c9828d70d7799b5b6d03 (patch)
treeaa31f3ea3b5ca01a97e13a777eed51c7dcbd17c4 /docs/standard_library.md
parent6e7208bec2911ac0d1729f334fc90bc50b8f9203 (diff)
feat: add $STD_VERSION replacement variable in docs (#6922)
Diffstat (limited to 'docs/standard_library.md')
-rw-r--r--docs/standard_library.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/standard_library.md b/docs/standard_library.md
index 6f11a68d6..ada5b36e7 100644
--- a/docs/standard_library.md
+++ b/docs/standard_library.md
@@ -27,7 +27,7 @@ change:
```typescript
// imports from v0.50.0 of std, never changes
-import { copy } from "https://deno.land/std@0.50.0/fs/copy.ts";
+import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
```
## Troubleshooting
@@ -40,7 +40,7 @@ exist:
```typescript
// main.ts
-import { copy } from "https://deno.land/std@0.50.0/fs/copy.ts";
+import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
copy("log.txt", "log-old.txt");
```
@@ -48,18 +48,18 @@ copy("log.txt", "log-old.txt");
```shell
$ deno run --allow-read --allow-write main.ts
Compile file:///dev/deno/main.ts
-Download https://deno.land/std@0.50.0/fs/copy.ts
-Download https://deno.land/std@0.50.0/fs/ensure_dir.ts
-Download https://deno.land/std@0.50.0/fs/_util.ts
+Download https://deno.land/std@$STD_VERSION/fs/copy.ts
+Download https://deno.land/std@$STD_VERSION/fs/ensure_dir.ts
+Download https://deno.land/std@$STD_VERSION/fs/_util.ts
error: TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'.
await Deno.utime(dest, statInfo.atime, statInfo.mtime);
~~~~~
- at https://deno.land/std@0.50.0/fs/copy.ts:90:16
+ at https://deno.land/std@$STD_VERSION/fs/copy.ts:90:16
TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'.
Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
~~~~~~~~~
- at https://deno.land/std@0.50.0/fs/copy.ts:101:10
+ at https://deno.land/std@$STD_VERSION/fs/copy.ts:101:10
```
Solution to that problem requires adding `--unstable` flag: