From d0eb179132c60a7c2513c9d19db03e3d5ca00c70 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:19:11 -0700 Subject: [PATCH] docs: end sentences with a period in markdown (#7813) --- README.md | 6 +++--- Releases.md | 4 ++-- cli/dts/README.md | 4 ++-- cli/rt/README.md | 20 +++++++++---------- cli/tests/unit/README.md | 16 +++++++-------- docs/contributing.md | 4 ++-- op_crates/web/README.md | 2 +- std/archive/README.md | 6 +++--- std/async/README.md | 6 +++--- std/bytes/README.md | 2 +- std/datetime/README.md | 42 ++++++++++++++++++++-------------------- std/encoding/README.md | 22 ++++++++++----------- std/flags/README.md | 12 ++++++------ std/fmt/README.md | 10 +++++----- std/fs/README.md | 10 +++++----- std/hash/README.md | 6 +++--- std/http/README.md | 4 ++-- std/io/README.md | 6 +++--- std/log/README.md | 38 ++++++++++++++++++------------------ std/path/README.md | 2 +- std/signal/README.md | 8 ++++---- std/testing/README.md | 12 ++++++------ std/uuid/README.md | 4 ++-- std/wasi/README.md | 2 +- std/ws/README.md | 10 +++++----- tools/README.md | 2 +- 26 files changed, 130 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index 8e16beef42..2e485a365f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Deno is a _simple_, _modern_ and _secure_ runtime for **JavaScript** and - Built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt). - Set of reviewed standard modules that are guaranteed to work with - [Deno](https://deno.land/std/) + [Deno](https://deno.land/std/). ### Install @@ -76,14 +76,14 @@ for await (const req of s) { You can find a more in depth introduction, examples, and environment setup guides in the [manual](https://deno.land/manual). -More in-depth info can be found in the runtime [documentation](doc.deno.land) +More in-depth info can be found in the runtime [documentation](doc.deno.land). ### Contributing We appreciate your help! To contribute, please read the our -[guidelines](https://github.com/denoland/deno/blob/master/docs/contributing/style_guide.md) +[guidelines](https://github.com/denoland/deno/blob/master/docs/contributing/style_guide.md). [Build Status - Cirrus]: https://github.com/denoland/deno/workflows/ci/badge.svg?branch=master&event=push [Build status]: https://github.com/denoland/deno/actions diff --git a/Releases.md b/Releases.md index 534b288cd3..d9c5ed4c15 100644 --- a/Releases.md +++ b/Releases.md @@ -1,9 +1,9 @@ # Releases -Binary releases can be downloaded manually at +Binary releases can be downloaded manually at: https://github.com/denoland/deno/releases -We also have one-line install commands at +We also have one-line install commands at: https://github.com/denoland/deno_install ### 1.4.4 / 2020.10.03 diff --git a/cli/dts/README.md b/cli/dts/README.md index f37c903df1..006282a90f 100644 --- a/cli/dts/README.md +++ b/cli/dts/README.md @@ -5,8 +5,8 @@ currently (unfortunately) have a rather manual process for upgrading TypeScript. It works like this currently: 1. Checkout typescript repo in a seperate directory. -2. Copy typescript.js into Deno repo -3. Copy d.ts files into dts directory +2. Copy typescript.js into Deno repo. +3. Copy d.ts files into dts directory. So that might look something like this: diff --git a/cli/rt/README.md b/cli/rt/README.md index f73163df21..b17fa22e56 100644 --- a/cli/rt/README.md +++ b/cli/rt/README.md @@ -22,14 +22,14 @@ Some Web APIs are using ops under the hood, eg. `console`, `performance`. ## Implemented Web APIs - [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob): for - representing opaque binary data + representing opaque binary data. - [Console](https://developer.mozilla.org/en-US/docs/Web/API/Console): for - logging purposes + logging purposes. - [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent), [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) and [EventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventListener): - to work with DOM events + to work with DOM events. - **Implementation notes:** There is no DOM hierarchy in Deno, so there is no tree for Events to bubble/capture through. - [fetch](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch), @@ -37,23 +37,23 @@ Some Web APIs are using ops under the hood, eg. `console`, `performance`. [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response), [Body](https://developer.mozilla.org/en-US/docs/Web/API/Body) and [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers): modern - Promise-based HTTP Request API + Promise-based HTTP Request API. - [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData): access - to a `multipart/form-data` serialization + to a `multipart/form-data` serialization. - [Performance](https://developer.mozilla.org/en-US/docs/Web/API/Performance): - retrieving current time with a high precision + retrieving current time with a high precision. - [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout), [setInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval), [clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout): scheduling callbacks in future and - [clearInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval) + [clearInterval](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval). - [Stream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) for - creating, composing, and consuming streams of data + creating, composing, and consuming streams of data. - [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) and [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams): - to construct and parse URLSs + to construct and parse URLSs. - [Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker): executing - additional code in a separate thread + additional code in a separate thread. - **Implementation notes:** Blob URLs are not supported, object ownership cannot be transferred, posted data is serialized to JSON instead of [structured cloning](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). diff --git a/cli/tests/unit/README.md b/cli/tests/unit/README.md index e15ad70802..4d70ada78b 100644 --- a/cli/tests/unit/README.md +++ b/cli/tests/unit/README.md @@ -26,13 +26,13 @@ unitTest({ `unitTest` is is a wrapper function that enhances `Deno.test()` API in several ways: -- ability to conditionally skip tests using `UnitTestOptions.skip` +- ability to conditionally skip tests using `UnitTestOptions.skip`. - ability to register required set of permissions for given test case using - `UnitTestOptions.perms` + `UnitTestOptions.perms`. - sanitization of resources - ensuring that tests close all opened resources - preventing interference between tests + preventing interference between tests. - sanitization of async ops - ensuring that tests don't leak async ops by - ensuring that all started async ops are done before test finishes + ensuring that all started async ops are done before test finishes. ## Running tests @@ -50,13 +50,13 @@ There are three ways to run `unit_test_runner.ts`: target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --master # By default all output of worker processes is discarded; for debug purposes -# the --verbose flag preserves output from the worker +# the --verbose flag preserves output from the worker. target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --master --verbose -# Run subset of tests that don't require any permissions +# Run subset of tests that don't require any permissions. target/debug/deno run --unstable cli/tests/unit/unit_test_runner.ts -# Run subset tests that require "net" and "read" permissions +# Run subset tests that require "net" and "read" permissions. target/debug/deno run --unstable --allow-net --allow-read cli/tests/unit/unit_test_runner.ts # "worker" mode communicates with parent using TCP socket on provided address; @@ -64,7 +64,7 @@ target/debug/deno run --unstable --allow-net --allow-read cli/tests/unit/unit_te # directly, only be "master" process. target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --worker --addr=127.0.0.1:4500 --perms=net,write,run -# Run specific tests +# Run specific tests. target/debug/deno run --unstable --allow-net cli/tests/unit/unit_test_runner.ts -- netTcpListenClose RUST_BACKTRACE=1 cargo run -- run --unstable --allow-read --allow-write cli/tests/unit/unit_test_runner.ts -- netUnixDialListen diff --git a/docs/contributing.md b/docs/contributing.md index dba1b62d13..7bbc186d02 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -25,7 +25,7 @@ Before submitting, please make sure the following is done: 1. That there is a related issue and it is referenced in the PR text. 2. There are tests that cover the changes. 3. Ensure `cargo test` passes. -4. Format your code with `./tools/format.py` +4. Format your code with `./tools/format.py`. 5. Make sure `./tools/lint.py` passes. ## Changes to `third_party` @@ -69,4 +69,4 @@ and are denoted by a leading `/**` before terminating with a `*/`. For example: export const FOO = "foo"; ``` -Find more at https://jsdoc.app/ +Find more at: https://jsdoc.app/ diff --git a/op_crates/web/README.md b/op_crates/web/README.md index 3ad8d43d89..778bd8f692 100644 --- a/op_crates/web/README.md +++ b/op_crates/web/README.md @@ -1,3 +1,3 @@ # deno web -Op crate that implements Event, TextEncoder, TextDecoder +Op crate that implements Event, TextEncoder, TextDecoder. diff --git a/std/archive/README.md b/std/archive/README.md index efa258ca4c..b14fd93756 100644 --- a/std/archive/README.md +++ b/std/archive/README.md @@ -12,12 +12,12 @@ await tar.append("deno.txt", { contentSize: content.byteLength, }); -// Or specifying a filePath +// Or specifying a filePath. await tar.append("land.txt", { filePath: "./land.txt", }); -// use tar.getReader() to read the contents +// use tar.getReader() to read the contents. const writer = await Deno.open("./out.tar", { write: true, create: true }); await Deno.copy(tar.getReader(), writer); @@ -53,7 +53,7 @@ for await (const entry of untar) { await ensureFile(entry.fileName); const file = await Deno.open(entry.fileName, { write: true }); - // is a reader + // is a reader. await Deno.copy(entry, file); } reader.close(); diff --git a/std/async/README.md b/std/async/README.md index ac7938e189..59c1a8aa77 100644 --- a/std/async/README.md +++ b/std/async/README.md @@ -4,11 +4,11 @@ async is a module to provide help with aysncronous tasks. # usage -The following functions and class are exposed in `mod.ts` +The following functions and class are exposed in `mod.ts`: ## deferred -Creates a Promise with the `reject` and `resolve` functions. +Create a Promise with the `reject` and `resolve` functions. ```typescript import { deferred } from "https://deno.land/std/async/mod.ts"; @@ -20,7 +20,7 @@ p.resolve(42); ## delay -Resolve a Promise after a given amount of milliseconds +Resolve a Promise after a given amount of milliseconds. ```typescript import { delay } from "https://deno.land/std/async/mod.ts"; diff --git a/std/bytes/README.md b/std/bytes/README.md index 0bcee4b1cd..265b28819d 100644 --- a/std/bytes/README.md +++ b/std/bytes/README.md @@ -4,7 +4,7 @@ bytes module is made to provide helpers to manipulation of bytes slice. # usage -All the following functions are exposed in `mod.ts` +All the following functions are exposed in `mod.ts`. ## findIndex diff --git a/std/datetime/README.md b/std/datetime/README.md index 9678ec4344..49752f7a78 100644 --- a/std/datetime/README.md +++ b/std/datetime/README.md @@ -8,29 +8,29 @@ The following symbols from [unicode LDML](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table) are supported: -- `yyyy` - numeric year -- `yy` - 2-digit year -- `M` - numeric month -- `MM` - 2-digit month -- `d` - numeric day -- `dd` - 2-digit day +- `yyyy` - numeric year. +- `yy` - 2-digit year. +- `M` - numeric month. +- `MM` - 2-digit month. +- `d` - numeric day. +- `dd` - 2-digit day. -- `H` - numeric hour (0-23 hours) -- `HH` - 2-digit hour (00-23 hours) -- `h` - numeric hour (1-12 hours) -- `hh` - 2-digit hour (01-12 hours) -- `m` - numeric minute -- `mm` - 2-digit minute -- `s` - numeric second -- `ss` - 2-digit second -- `S` - 1-digit fractionalSecond -- `SS` - 2-digit fractionalSecond -- `SSS` - 3-digit fractionalSecond +- `H` - numeric hour (0-23 hours). +- `HH` - 2-digit hour (00-23 hours). +- `h` - numeric hour (1-12 hours). +- `hh` - 2-digit hour (01-12 hours). +- `m` - numeric minute. +- `mm` - 2-digit minute. +- `s` - numeric second. +- `ss` - 2-digit second. +- `S` - 1-digit fractionalSecond. +- `SS` - 2-digit fractionalSecond. +- `SSS` - 3-digit fractionalSecond. -- `a` - dayPeriod, either `AM` or `PM` +- `a` - dayPeriod, either `AM` or `PM`. -- `'foo'` - quoted literal -- `./-` - unquoted literal +- `'foo'` - quoted literal. +- `./-` - unquoted literal. ### parse @@ -78,7 +78,7 @@ dayOfYear(new Date("2019-03-11T03:24:00")); // output: 70 ### weekOfYear -Returns the ISO week number of the provided date (1-53) +Returns the ISO week number of the provided date (1-53). ```ts import { weekOfYear } from "https://deno.land/std/datetime/mod.ts"; diff --git a/std/encoding/README.md b/std/encoding/README.md index 2f0ac91f1e..9dec37a330 100644 --- a/std/encoding/README.md +++ b/std/encoding/README.md @@ -70,12 +70,12 @@ function is as follows: ##### `ReadOptions` -- **`comma?: string;`**: Character which separates values. Default: `','` -- **`comment?: string;`**: Character to start a comment. Default: `'#'` +- **`comma?: string;`**: Character which separates values. Default: `','`. +- **`comment?: string;`**: Character to start a comment. Default: `'#'`. - **`trimLeadingSpace?: boolean;`**: Flag to trim the leading space of the - value. Default: `false` + value. Default: `false`. - **`lazyQuotes?: boolean;`**: Allow unquoted quote in a quoted field or non - double quoted quotes in quoted field. Default: 'false` + double quoted quotes in quoted field. Default: `false`. - **`fieldsPerRecord?`**: Enabling the check of fields for each row. If == 0, first row is used as referral for the number of fields. @@ -226,9 +226,9 @@ console.log(tomlObject); ## YAML -YAML parser / dumper for Deno +YAML parser / dumper for Deno. -Heavily inspired from [js-yaml] +Heavily inspired from [js-yaml]. ### Basic usage @@ -294,17 +294,17 @@ Serializes `object` as a YAML document. ### :warning: Limitations -- `binary` type is currently not stable -- `function`, `regexp`, and `undefined` type are currently not supported +- `binary` type is currently not stable. +- `function`, `regexp`, and `undefined` type are currently not supported. ### More example -See https://github.com/nodeca/js-yaml. +See: https://github.com/nodeca/js-yaml ## base32 [RFC4648 base32](https://tools.ietf.org/html/rfc4648#section-6) encoder/decoder -for Deno +for Deno. ### Basic usage @@ -326,7 +326,7 @@ console.log(encode(binaryData)); ## ascii85 -Ascii85/base85 encoder and decoder with support for multiple standards +Ascii85/base85 encoder and decoder with support for multiple standards. ### Basic usage diff --git a/std/flags/README.md b/std/flags/README.md index ebfc346e19..80b05549db 100644 --- a/std/flags/README.md +++ b/std/flags/README.md @@ -1,6 +1,6 @@ # flags -Command line arguments parser for Deno based on minimist +Command line arguments parser for Deno based on minimist. # Example @@ -42,15 +42,15 @@ Any arguments after `'--'` will not be parsed and will end up in `parsedArgs._`. options can be: - `options.string` - a string or array of strings argument names to always treat - as strings + as strings. - `options.boolean` - a boolean, string or array of strings to always treat as booleans. if `true` will treat all double hyphenated arguments without equal - signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) + signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`). - `options.alias` - an object mapping string names to strings or arrays of - string argument names to use as aliases -- `options.default` - an object mapping string argument names to default values + string argument names to use as aliases. +- `options.default` - an object mapping string argument names to default values. - `options.stopEarly` - when true, populate `parsedArgs._` with everything after - the first non-option + the first non-option. - `options['--']` - when true, populate `parsedArgs._` with everything before the `--` and `parsedArgs['--']` with everything after the `--`. Here's an example: diff --git a/std/fmt/README.md b/std/fmt/README.md index 700943567b..d71fdf4d03 100644 --- a/std/fmt/README.md +++ b/std/fmt/README.md @@ -42,14 +42,14 @@ This is very much a work-in-progress. I'm actively soliciting feedback. - currently contains little in the way of checking for correctness. Conceivably, there will be a 'strict' form, e.g. that ensures only Number-ish arguments are - passed to %f flags + passed to %f flags. - assembles output using string concatenation instead of utilizing buffers or other optimizations. It would be nice to have printf / sprintf / fprintf (etc) all in one. - float formatting is handled by toString() and to `toExponential` along with a - mess of Regexp. Would be nice to use fancy match + mess of Regexp. Would be nice to use fancy match. - some flags that are potentially applicable ( POSIX long and unsigned modifiers are not likely useful) are missing, namely %q (print quoted), %U (unicode @@ -70,7 +70,7 @@ list. E.g.: Hello %s! -applied to the arguments "World" yields "Hello World!" +applied to the arguments "World" yields "Hello World!". The meaning of the format string is modelled after [POSIX][1] format strings as well as well as [Golang format strings][2]. Both contain elements specific to @@ -128,7 +128,7 @@ which case the values are obtained from the next args, e.g.: sprintf("%*.*f", 9, 8, 456.0) -is equivalent to +is equivalent to: sprintf("%9.8f", 456.0) @@ -156,7 +156,7 @@ directive: The default format used by `%v` is the result of calling `toString()` on the relevant argument. If the `#` flags is used, the result of calling `inspect()` is interpolated. In this case, the precision, if set is passed to `inspect()` as -the 'depth' config parameter +the 'depth' config parameter. ## Positional arguments diff --git a/std/fs/README.md b/std/fs/README.md index 73d0abbf19..e2483df1e5 100644 --- a/std/fs/README.md +++ b/std/fs/README.md @@ -5,7 +5,7 @@ fs module is made to provide helpers to manipulate the filesystem. ## Usage Most the following modules are exposed in `mod.ts` This feature is currently -unstable. To enable it use `deno run --unstable` +unstable. To enable it use `deno run --unstable`. ### emptyDir @@ -23,7 +23,7 @@ emptyDirSync("./foo"); // void ### ensureDir Ensures that the directory exists. If the directory structure does not exist, it -is created. Like mkdir -p. +is created. Like `mkdir -p`. ```ts import { ensureDir, ensureDirSync } from "https://deno.land/std/fs/mod.ts"; @@ -83,7 +83,7 @@ format(CRLFinput, EOL.LF); // output "deno\nis not\nnode" ### exists -Test whether or not the given path exists by checking with the file system +Test whether or not the given path exists by checking with the file system. ```ts import { exists, existsSync } from "https://deno.land/std/fs/mod.ts"; @@ -94,7 +94,7 @@ existsSync("./foo"); // returns boolean ### move -Moves a file or directory. Overwrites it if option provided +Moves a file or directory. Overwrites it if option provided. ```ts import { move, moveSync } from "https://deno.land/std/fs/mod.ts"; @@ -107,7 +107,7 @@ moveSync("./foo", "./existingFolder", { overwrite: true }); ### copy -copy a file or directory. Overwrites it if option provided +copy a file or directory. Overwrites it if option provided. ```ts import { copy, copySync } from "https://deno.land/std/fs/mod.ts"; diff --git a/std/hash/README.md b/std/hash/README.md index 1716f0ffc3..3000cbd05f 100644 --- a/std/hash/README.md +++ b/std/hash/README.md @@ -23,7 +23,7 @@ import { createHash } from "https://deno.land/std/hash/mod.ts"; const hash = createHash("md5"); hash.update("Your data here"); -const final = hash.digest(); // returns ArrayBuffer +const final = hash.digest(); // returns ArrayBuffer. ``` Please note that `digest` invalidates the hash instance's internal state. @@ -34,8 +34,8 @@ import { createHash } from "https://deno.land/std/hash/mod.ts"; const hash = createHash("md5"); hash.update("Your data here"); -const final1 = hash.digest(); // returns ArrayBuffer -const final2 = hash.digest(); // throws Error +const final1 = hash.digest(); // returns ArrayBuffer. +const final2 = hash.digest(); // throws Error. ``` If you need final hash in string formats, call `toString` method with output diff --git a/std/http/README.md b/std/http/README.md index 3383c0778b..be41f4fe1d 100644 --- a/std/http/README.md +++ b/std/http/README.md @@ -11,7 +11,7 @@ for await (const req of server) { ### File Server -A small program for serving local files over HTTP +A small program for serving local files over HTTP. ```sh deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts @@ -35,7 +35,7 @@ console.log("cookies:", cookies); // cookies: { full: "of", tasty: "chocolate" } ``` -To set a `Cookie` you can add `CookieOptions` to properly set your `Cookie` +To set a `Cookie` you can add `CookieOptions` to properly set your `Cookie`: ```ts import { Response } from "https://deno.land/std/http/server.ts"; diff --git a/std/io/README.md b/std/io/README.md index ca0f5f4415..25bd9881bd 100644 --- a/std/io/README.md +++ b/std/io/README.md @@ -6,7 +6,7 @@ ### readLines -Read reader[like file], line by line +Read reader[like file], line by line: ```ts title="readLines" import { readLines } from "https://deno.land/std/io/mod.ts"; @@ -128,7 +128,7 @@ base0123456789 ### fromStreamReader -Creates a `Reader` from a `ReadableStreamDefaultReader` +Creates a `Reader` from a `ReadableStreamDefaultReader`. ```ts import { fromStreamReader } from "https://deno.land/std/io/mod.ts"; @@ -142,7 +142,7 @@ file.close(); ### fromStreamWriter -Creates a `Writer` from a `WritableStreamDefaultWriter` +Creates a `Writer` from a `WritableStreamDefaultWriter`. ```ts import { fromStreamWriter } from "https://deno.land/std/io/mod.ts"; diff --git a/std/log/README.md b/std/log/README.md index 8f18a15d47..9057121419 100644 --- a/std/log/README.md +++ b/std/log/README.md @@ -14,20 +14,20 @@ log.warning(true); log.error({ foo: "bar", fizz: "bazz" }); log.critical("500 Internal server error"); -// custom configuration with 2 loggers (the default and `tasks` loggers) +// custom configuration with 2 loggers (the default and `tasks` loggers). await log.setup({ handlers: { console: new log.handlers.ConsoleHandler("DEBUG"), file: new log.handlers.FileHandler("WARNING", { filename: "./log.txt", - // you can change format of output message using any keys in `LogRecord` + // you can change format of output message using any keys in `LogRecord`. formatter: "{levelName} {msg}", }), }, loggers: { - // configure default logger available via short-hand methods above + // configure default logger available via short-hand methods above. default: { level: "DEBUG", handlers: ["console", "file"], @@ -42,19 +42,19 @@ await log.setup({ let logger; -// get default logger +// get default logger. logger = log.getLogger(); -logger.debug("fizz"); // logs to `console`, because `file` handler requires "WARNING" level -logger.warning(41256); // logs to both `console` and `file` handlers +logger.debug("fizz"); // logs to `console`, because `file` handler requires "WARNING" level. +logger.warning(41256); // logs to both `console` and `file` handlers. // get custom logger logger = log.getLogger("tasks"); -logger.debug("fizz"); // won't get output because this logger has "ERROR" level -logger.error({ productType: "book", value: "126.11" }); // log to `console` +logger.debug("fizz"); // won't get output because this logger has "ERROR" level. +logger.error({ productType: "book", value: "126.11" }); // log to `console`. // if you try to use a logger that hasn't been configured // you're good to go, it gets created automatically with level set to 0 -// so no message is logged +// so no message is logged. const unknownLogger = log.getLogger("mystery"); unknownLogger.info("foobar"); // no-op ``` @@ -124,11 +124,11 @@ interface FileHandlerOptions { Behavior of the log modes is as follows: - `'a'` - Default mode. Appends new log messages to the end of an existing log - file, or create a new log file if none exists + file, or create a new log file if none exists. - `'w'` - Upon creation of the handler, any existing log file will be removed and a new one created. - `'x'` - This will create a new log file and throw an error if one already - exists + exists. This handler requires `--allow-write` permission on the log file. @@ -177,7 +177,7 @@ Additional notes on `mode` as described above: cause any existing backups (up to `maxBackupCount`) to be deleted on setup giving a fully clean slate. - `'x'` requires that neither `filename`, nor any backups (up to - `maxBackupCount`), exist before setup + `maxBackupCount`), exist before setup. This handler requires both `--allow-read` and `--allow-write` permissions on the log files. @@ -227,16 +227,16 @@ await log.setup({ } }) -// calling +// calling: log.debug("Hello, world!", 1, "two", [3, 4, 5]); // results in: -[DEBUG] Hello, world! // output from "stringFmt" handler -10 Hello, world!, arg0: 1, arg1: two, arg3: [3, 4, 5] // output from "functionFmt" formatter +[DEBUG] Hello, world! // output from "stringFmt" handler. +10 Hello, world!, arg0: 1, arg1: two, arg3: [3, 4, 5] // output from "functionFmt" formatter. -// calling +// calling: log.getLogger("dataLogger").error("oh no!"); // results in: -[dataLogger] - ERROR oh no! // output from anotherFmt handler +[dataLogger] - ERROR oh no! // output from anotherFmt handler. ``` #### Custom handlers @@ -278,7 +278,7 @@ log evaluation to prevent the computation taking place if the logger won't log the message. ```ts -// `expensiveFn(5)` is only evaluated if this logger is configured for debug logging +// `expensiveFn(5)` is only evaluated if this logger is configured for debug logging. logger.debug(() => `this is expensive: ${expensiveFn(5)}`); ``` @@ -303,7 +303,7 @@ await log.setup({ }, }); -// not logged, as debug < error +// not logged, as debug < error. const data: string | undefined = logger.debug(() => someExpenseFn(5, true)); console.log(data); // undefined ``` diff --git a/std/path/README.md b/std/path/README.md index 9a9361f87e..88fcc227cc 100644 --- a/std/path/README.md +++ b/std/path/README.md @@ -18,5 +18,5 @@ globToRegExp("foo/**/*.json", { flags: "g", extended: true, globstar: true, -}); // returns the regex to find all .json files in the folder foo +}); // returns the regex to find all .json files in the folder foo. ``` diff --git a/std/signal/README.md b/std/signal/README.md index 9684faba87..7a152cdca7 100644 --- a/std/signal/README.md +++ b/std/signal/README.md @@ -1,10 +1,10 @@ # signal -signal is a module used to capture and monitor OS signals +signal is a module used to capture and monitor OS signals. # usage -The following functions are exposed in `mod.ts` +The following functions are exposed in `mod.ts`: ## signal @@ -14,7 +14,7 @@ Generates an AsyncIterable which can be awaited on for one or more signals. ```typescript import { signal } from "https://deno.land/std/signal/mod.ts"; const sig = signal(Deno.Signal.SIGUSR1, Deno.Signal.SIGINT); -setTimeout(() => {}, 5000); // Prevents exiting immediately +setTimeout(() => {}, 5000); // Prevents exiting immediately. for await (const _ of sig) { // .. @@ -33,6 +33,6 @@ import { onSignal } from "https://deno.land/std/signal/mod.ts"; const handle = onSignal(Deno.Signal.SIGINT, () => { // ... - handle.dispose(); // de-register from receiving further events + handle.dispose(); // de-register from receiving further events. }); ``` diff --git a/std/testing/README.md b/std/testing/README.md index 82351d94ac..0b0e8afe96 100644 --- a/std/testing/README.md +++ b/std/testing/README.md @@ -34,8 +34,8 @@ pretty-printed diff of failing assertion. function will throw asynchronously. Also compares any errors thrown to an optional expected `Error` class and checks that the error `.message` includes an optional string. -- `unimplemented()` - Use this to stub out methods that will throw when invoked -- `unreachable()` - Used to assert unreachable code +- `unimplemented()` - Use this to stub out methods that will throw when invoked. +- `unreachable()` - Used to assert unreachable code. Basic usage: @@ -96,7 +96,7 @@ Deno.test("doesThrow", function (): void { ); }); -// This test will not pass +// This test will not pass. Deno.test("fails", function (): void { assertThrows((): void => { console.log("Hello world"); @@ -130,7 +130,7 @@ Deno.test("doesThrow", async function (): Promise { ); }); -// This test will not pass +// This test will not pass. Deno.test("fails", async function (): Promise { await assertThrowsAsync( async (): Promise => { @@ -199,7 +199,7 @@ runBenchmarks() console.log(results); }) .catch((error: Error) => { - // ... errors if benchmark was badly constructed + // ... errors if benchmark was badly constructed. }); ``` @@ -213,7 +213,7 @@ commandline. ```ts runBenchmarks({ silent: true }, (p: BenchmarkRunProgress) => { - // initial progress data + // initial progress data. if (p.state === ProgressState.BenchmarkingStart) { console.log( `Starting benchmarking. Queued: ${p.queued.length}, filtered: ${p.filtered}`, diff --git a/std/uuid/README.md b/std/uuid/README.md index 538dc7f02a..4df1084c4e 100644 --- a/std/uuid/README.md +++ b/std/uuid/README.md @@ -7,9 +7,9 @@ Support for version 1, 4, and 5 UUIDs. ```ts import { v4 } from "https://deno.land/std/uuid/mod.ts"; -// Generate a v4 uuid +// Generate a v4 uuid. const myUUID = v4.generate(); -// Validate a v4 uuid +// Validate a v4 uuid. const isValid = v4.validate(myUUID); ``` diff --git a/std/wasi/README.md b/std/wasi/README.md index c0c9f5c5a1..55a3e6939c 100644 --- a/std/wasi/README.md +++ b/std/wasi/README.md @@ -1,6 +1,6 @@ # wasi -This module provides an implementation of the WebAssembly System Interface +This module provides an implementation of the WebAssembly System Interface. ## Supported Syscalls diff --git a/std/ws/README.md b/std/ws/README.md index 54efc57cc5..329116a22e 100644 --- a/std/ws/README.md +++ b/std/ws/README.md @@ -21,18 +21,18 @@ async function handleWs(sock: WebSocket) { try { for await (const ev of sock) { if (typeof ev === "string") { - // text message + // text message. console.log("ws:Text", ev); await sock.send(ev); } else if (ev instanceof Uint8Array) { - // binary message + // binary message. console.log("ws:Binary", ev); } else if (isWebSocketPingEvent(ev)) { const [, body] = ev; - // ping + // ping. console.log("ws:Ping", body); } else if (isWebSocketCloseEvent(ev)) { - // close + // close. const { code, reason } = ev; console.log("ws:Close", code, reason); } @@ -99,7 +99,7 @@ Create mask from the client to the server with random 32bit number. ### acceptable -Returns true if input headers are usable for WebSocket, otherwise false +Returns true if input headers are usable for WebSocket, otherwise false. ### createSecAccept diff --git a/tools/README.md b/tools/README.md index ad4dfa603b..be5b5394d3 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,6 +1,6 @@ # Tools -Documentation for various tooling in support of Deno development +Documentation for various tooling in support of Deno development. ## format.py