summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benching/mod.ts2
-rw-r--r--colors/mod.ts2
-rw-r--r--examples/echo_server.ts2
-rwxr-xr-xexamples/gist.ts2
-rw-r--r--examples/test.ts2
-rw-r--r--flags/README.md2
-rw-r--r--flags/example.ts2
-rwxr-xr-xformat.ts2
-rw-r--r--fs/path/constants.ts2
-rw-r--r--fs/path/mod.ts2
-rw-r--r--fs/path/resolve_test.ts2
-rw-r--r--fs/path/zero_length_strings_test.ts2
-rw-r--r--fs/walk.ts13
-rw-r--r--fs/walk_test.ts7
-rwxr-xr-xhttp/file_server.ts3
-rw-r--r--http/file_server_test.ts2
-rw-r--r--http/server.ts3
-rw-r--r--http/server_test.ts2
-rw-r--r--io/bufio_test.ts3
-rw-r--r--io/ioutil_test.ts3
-rw-r--r--io/readers_test.ts2
-rw-r--r--io/util.ts3
-rw-r--r--io/util_test.ts2
-rw-r--r--io/writers_test.ts2
-rw-r--r--log/handlers.ts3
-rw-r--r--multipart/multipart.ts4
-rw-r--r--multipart/multipart_test.ts2
-rwxr-xr-xprettier/main.ts11
-rw-r--r--prettier/main_test.ts2
-rw-r--r--prettier/util.ts2
-rw-r--r--ws/mod.ts3
-rw-r--r--ws/test.ts2
32 files changed, 43 insertions, 55 deletions
diff --git a/benching/mod.ts b/benching/mod.ts
index be77b52c2..61df5c06b 100644
--- a/benching/mod.ts
+++ b/benching/mod.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { exit, noColor } from "deno";
+const { exit, noColor } = Deno;
interface BenchmarkClock {
start: number;
diff --git a/colors/mod.ts b/colors/mod.ts
index c8bb5b539..7a45905ce 100644
--- a/colors/mod.ts
+++ b/colors/mod.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { noColor } from "deno";
+const { noColor } = Deno;
interface Code {
open: string;
diff --git a/examples/echo_server.ts b/examples/echo_server.ts
index 5776e77ef..95b9f7413 100644
--- a/examples/echo_server.ts
+++ b/examples/echo_server.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { listen, copy } from "deno";
+const { listen, copy } = Deno;
(async () => {
const addr = "0.0.0.0:8080";
diff --git a/examples/gist.ts b/examples/gist.ts
index 860678d88..8ce68a946 100755
--- a/examples/gist.ts
+++ b/examples/gist.ts
@@ -1,7 +1,7 @@
#!/usr/bin/env deno --allow-net --allow-env
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { args, env, exit, readFile } from "deno";
+const { args, env, exit, readFile } = Deno;
import { parse } from "https://deno.land/x/flags/mod.ts";
function pathBase(p: string): string {
diff --git a/examples/test.ts b/examples/test.ts
index 65ff7efa1..30fdcfc4a 100644
--- a/examples/test.ts
+++ b/examples/test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { run } from "deno";
+const { run } = Deno;
import { test, assertEqual } from "../testing/mod.ts";
/** Example of how to do basic tests */
diff --git a/flags/README.md b/flags/README.md
index 7b63006d6..b002bf56a 100644
--- a/flags/README.md
+++ b/flags/README.md
@@ -5,7 +5,7 @@ Command line arguments parser for Deno based on minimist
# Example
```ts
-import { args } from "deno";
+const { args } = Deno;
import { parse } from "https://deno.land/x/flags/mod.ts";
console.dir(parse(args));
diff --git a/flags/example.ts b/flags/example.ts
index 54d64b681..04ace4673 100644
--- a/flags/example.ts
+++ b/flags/example.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { args } from "deno";
+const { args } = Deno;
import { parse } from "./mod.ts";
console.dir(parse(args));
diff --git a/format.ts b/format.ts
index 4de5cfa87..fa538d53f 100755
--- a/format.ts
+++ b/format.ts
@@ -1,6 +1,6 @@
#!/usr/bin/env deno --allow-run --allow-write --allow-read
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { exit, args } from "deno";
+const { exit, args } = Deno;
import { parse } from "./flags/mod.ts";
import { xrun, executableSuffix } from "./prettier/util.ts";
diff --git a/fs/path/constants.ts b/fs/path/constants.ts
index ce121f9ac..cfba4ebd8 100644
--- a/fs/path/constants.ts
+++ b/fs/path/constants.ts
@@ -1,7 +1,7 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { platform } from "deno";
+const { platform } = Deno;
// Alphabet chars.
export const CHAR_UPPERCASE_A = 65; /* A */
diff --git a/fs/path/mod.ts b/fs/path/mod.ts
index 7adb230d2..4ca630ed6 100644
--- a/fs/path/mod.ts
+++ b/fs/path/mod.ts
@@ -1,7 +1,7 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
-import { cwd, env } from "deno";
+const { cwd, env } = Deno;
import { FormatInputPathObject, ParsedPath } from "./interface.ts";
import {
isWindows,
diff --git a/fs/path/resolve_test.ts b/fs/path/resolve_test.ts
index 7c2b55249..2259dd025 100644
--- a/fs/path/resolve_test.ts
+++ b/fs/path/resolve_test.ts
@@ -1,9 +1,9 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
+const { cwd } = Deno;
import { test, assertEqual } from "../../testing/mod.ts";
import * as path from "./mod.ts";
-import { cwd } from "deno";
const windowsTests =
// arguments result
diff --git a/fs/path/zero_length_strings_test.ts b/fs/path/zero_length_strings_test.ts
index d069c781f..c769c9a79 100644
--- a/fs/path/zero_length_strings_test.ts
+++ b/fs/path/zero_length_strings_test.ts
@@ -1,9 +1,9 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
+const { cwd } = Deno;
import { test, assertEqual } from "../../testing/mod.ts";
import * as path from "./mod.ts";
-import { cwd } from "deno";
const pwd = cwd();
diff --git a/fs/walk.ts b/fs/walk.ts
index 92e4ba593..10393ae0b 100644
--- a/fs/walk.ts
+++ b/fs/walk.ts
@@ -1,14 +1,5 @@
-import {
- FileInfo,
- cwd,
- readDir,
- readDirSync,
- readlink,
- readlinkSync,
- stat,
- statSync
-} from "deno";
-import { relative } from "path.ts";
+const { readDir, readDirSync, readlink, readlinkSync, stat, statSync } = Deno;
+import { FileInfo } from "deno";
export interface WalkOptions {
maxDepth?: number;
diff --git a/fs/walk_test.ts b/fs/walk_test.ts
index 7f21a2fb4..d54273995 100644
--- a/fs/walk_test.ts
+++ b/fs/walk_test.ts
@@ -1,15 +1,14 @@
-import {
+const {
cwd,
chdir,
- FileInfo,
makeTempDir,
mkdir,
open,
platform,
remove,
symlink
-} from "deno";
-
+} = Deno;
+import { FileInfo } from "deno";
import { walk, walkSync, WalkOptions } from "./walk.ts";
import { test, assert, TestFunction } from "../testing/mod.ts";
diff --git a/http/file_server.ts b/http/file_server.ts
index 1f3fdd586..20ad45be6 100755
--- a/http/file_server.ts
+++ b/http/file_server.ts
@@ -6,13 +6,14 @@
// TODO Add tests like these:
// https://github.com/indexzero/http-server/blob/master/test/http-server-test.js
+const { ErrorKind, cwd, args, stat, readDir, open } = Deno;
+import { DenoError } from "deno";
import {
listenAndServe,
ServerRequest,
setContentLength,
Response
} from "./server.ts";
-import { cwd, DenoError, ErrorKind, args, stat, readDir, open } from "deno";
import { extname } from "../fs/path.ts";
import { contentType } from "../media_types/mod.ts";
diff --git a/http/file_server_test.ts b/http/file_server_test.ts
index 698857dce..cf4b8dcbd 100644
--- a/http/file_server_test.ts
+++ b/http/file_server_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { readFile, run } from "deno";
+const { readFile, run } = Deno;
import { test, assert, assertEqual } from "../testing/mod.ts";
import { BufReader } from "../io/bufio.ts";
diff --git a/http/server.ts b/http/server.ts
index 400171fc5..c6cd95f86 100644
--- a/http/server.ts
+++ b/http/server.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { listen, Conn, toAsyncIterator, Reader, Writer, copy } from "deno";
+const { listen, toAsyncIterator, copy } = Deno;
+import { Conn, Reader, Writer } from "deno";
import { BufReader, BufState, BufWriter } from "../io/bufio.ts";
import { TextProtoReader } from "../textproto/mod.ts";
import { STATUS_TEXT } from "./http_status.ts";
diff --git a/http/server_test.ts b/http/server_test.ts
index 099547d0c..cc5863eb5 100644
--- a/http/server_test.ts
+++ b/http/server_test.ts
@@ -5,7 +5,7 @@
// Ported from
// https://github.com/golang/go/blob/master/src/net/http/responsewrite_test.go
-import { Buffer } from "deno";
+const { Buffer } = Deno;
import { assertEqual, test } from "../testing/mod.ts";
import { Response, ServerRequest } from "./server.ts";
import { BufReader, BufWriter } from "../io/bufio.ts";
diff --git a/io/bufio_test.ts b/io/bufio_test.ts
index e63f1c5c9..0a261daea 100644
--- a/io/bufio_test.ts
+++ b/io/bufio_test.ts
@@ -3,7 +3,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-import { Buffer, Reader, ReadResult } from "deno";
+const { Buffer } = Deno;
+import { Reader, ReadResult } from "deno";
import { test, assert, assertEqual } from "../testing/mod.ts";
import { BufReader, BufState, BufWriter } from "./bufio.ts";
import * as iotest from "./iotest.ts";
diff --git a/io/ioutil_test.ts b/io/ioutil_test.ts
index 2c78b2562..168aad52a 100644
--- a/io/ioutil_test.ts
+++ b/io/ioutil_test.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { Buffer, Reader, ReadResult } from "deno";
+const { Buffer } = Deno;
+import { Reader, ReadResult } from "deno";
import { assert, assertEqual, runTests, test } from "../testing/mod.ts";
import {
copyN,
diff --git a/io/readers_test.ts b/io/readers_test.ts
index 0bc8ca36a..8da9d6e73 100644
--- a/io/readers_test.ts
+++ b/io/readers_test.ts
@@ -1,7 +1,7 @@
+const { copy } = Deno;
import { assert, test } from "../testing/mod.ts";
import { MultiReader, StringReader } from "./readers.ts";
import { StringWriter } from "./writers.ts";
-import { copy } from "deno";
import { copyN } from "./ioutil.ts";
import { decode } from "../strings/strings.ts";
diff --git a/io/util.ts b/io/util.ts
index 954808c6c..d87776ee5 100644
--- a/io/util.ts
+++ b/io/util.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { Buffer, File, mkdir, open, Reader } from "deno";
+const { Buffer, mkdir, open } = Deno;
+import { File, Reader } from "deno";
import { encode } from "../strings/strings.ts";
import * as path from "../fs/path.ts";
// `off` is the offset into `dst` where it will at which to begin writing values
diff --git a/io/util_test.ts b/io/util_test.ts
index c3f134616..62cdfe533 100644
--- a/io/util_test.ts
+++ b/io/util_test.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+const { remove } = Deno;
import { test, assert } from "../testing/mod.ts";
import { copyBytes, tempFile } from "./util.ts";
-import { remove } from "deno";
import * as path from "../fs/path.ts";
test(function testCopyBytes() {
diff --git a/io/writers_test.ts b/io/writers_test.ts
index 01388497c..94c58417d 100644
--- a/io/writers_test.ts
+++ b/io/writers_test.ts
@@ -1,8 +1,8 @@
+const { copy } = Deno;
import { assert, test } from "../testing/mod.ts";
import { StringWriter } from "./writers.ts";
import { StringReader } from "./readers.ts";
import { copyN } from "./ioutil.ts";
-import { copy } from "deno";
test(async function ioStringWriter() {
const w = new StringWriter("base");
diff --git a/log/handlers.ts b/log/handlers.ts
index 5c65c4fd0..96d8c056f 100644
--- a/log/handlers.ts
+++ b/log/handlers.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { open, File, Writer } from "deno";
+const { open } = Deno;
+import { File, Writer } from "deno";
import { getLevelByName, LogLevel } from "./levels.ts";
import { LogRecord } from "./logger.ts";
import { red, yellow, blue, bold } from "../colors/mod.ts";
diff --git a/multipart/multipart.ts b/multipart/multipart.ts
index f0caa2160..70874ed85 100644
--- a/multipart/multipart.ts
+++ b/multipart/multipart.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { Buffer, Closer, copy, Reader, ReadResult, remove, Writer } from "deno";
-
+const { Buffer, copy, remove } = Deno;
+import { Closer, Reader, ReadResult, Writer } from "deno";
import { FormFile } from "./formfile.ts";
import {
bytesFindIndex,
diff --git a/multipart/multipart_test.ts b/multipart/multipart_test.ts
index 3181e45c1..a87db60d7 100644
--- a/multipart/multipart_test.ts
+++ b/multipart/multipart_test.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+const { Buffer, copy, open, remove } = Deno;
import { assert, test } from "../testing/mod.ts";
import {
matchAfterPrefix,
@@ -7,7 +8,6 @@ import {
MultipartWriter,
scanUntilBoundary
} from "./multipart.ts";
-import { Buffer, copy, open, remove } from "deno";
import * as path from "../fs/path.ts";
import { FormFile, isFormFile } from "./formfile.ts";
import { StringWriter } from "../io/writers.ts";
diff --git a/prettier/main.ts b/prettier/main.ts
index 435206dcd..70c225086 100755
--- a/prettier/main.ts
+++ b/prettier/main.ts
@@ -2,16 +2,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// This script formats the given source files. If the files are omitted, it
// formats the all files in the repository.
-import {
- args,
- platform,
- readAll,
- lstat,
- exit,
- run,
- readFile,
- writeFile
-} from "deno";
+const { args, platform, readAll, lstat, exit, run, readFile, writeFile } = Deno;
import { xrun } from "./util.ts";
import { parse } from "../flags/mod.ts";
import { prettier, prettierPlugins } from "./prettier.ts";
diff --git a/prettier/main_test.ts b/prettier/main_test.ts
index d770d7232..165081e00 100644
--- a/prettier/main_test.ts
+++ b/prettier/main_test.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, assertEqual } from "../testing/mod.ts";
import { xrun, executableSuffix } from "./util.ts";
-import { readAll } from "deno";
+const { readAll } = Deno;
const decoder = new TextDecoder();
diff --git a/prettier/util.ts b/prettier/util.ts
index 179be444b..0be583f75 100644
--- a/prettier/util.ts
+++ b/prettier/util.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { platform, run } from "deno";
+const { platform, run } = Deno;
// Runs a command in cross-platform way
export function xrun(opts) {
diff --git a/ws/mod.ts b/ws/mod.ts
index 6433a75d1..bb943c714 100644
--- a/ws/mod.ts
+++ b/ws/mod.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { Buffer, Writer, Conn } from "deno";
+const { Buffer } = Deno;
+import { Writer, Conn } from "deno";
import { BufReader, BufWriter } from "../io/bufio.ts";
import { readLong, readShort, sliceLongToBytes } from "../io/ioutil.ts";
import { Sha1 } from "./sha1.ts";
diff --git a/ws/test.ts b/ws/test.ts
index 684c43002..46ea1cb83 100644
--- a/ws/test.ts
+++ b/ws/test.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import "./sha1_test.ts";
-import { Buffer } from "deno";
+const { Buffer } = Deno;
import { BufReader } from "../io/bufio.ts";
import { assert, assertEqual, test } from "../testing/mod.ts";
import {