mirror of
https://github.com/denoland/deno.git
synced 2025-02-08 07:16:56 -05:00
Miscellaneous documentation and spelling improvements (#5527)
* Extended/updated documentation on code editor setup and plugins. * Moved documentation to the right file. * Fixed spelling errors in documentation and code. * Updated broken links. Co-authored-by: 迷渡 <justjavac@gmail.com> Co-authored-by: AlfieriChou <alfierichou@gmail.com> Co-authored-by: Anil Seervi <anil13112000@gmail.com Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com> Co-authored-by: József Sallai <jozsef@sallai.me> Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de> Co-authored-by: Tommy May <tommymay37@gmail.com> Co-authored-by: Turbinya <wownucleos@gmail.com> Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>
This commit is contained in:
parent
eddb916883
commit
36fde75d77
13 changed files with 47 additions and 34 deletions
|
@ -184,7 +184,7 @@ static ENV_VARIABLES_HELP: &str = "ENVIRONMENT VARIABLES:
|
||||||
|
|
||||||
static DENO_HELP: &str = "A secure JavaScript and TypeScript runtime
|
static DENO_HELP: &str = "A secure JavaScript and TypeScript runtime
|
||||||
|
|
||||||
Docs: https://deno.land/std/manual.md
|
Docs: https://deno.land/manual
|
||||||
Modules: https://deno.land/std/ https://deno.land/x/
|
Modules: https://deno.land/std/ https://deno.land/x/
|
||||||
Bugs: https://github.com/denoland/deno/issues
|
Bugs: https://github.com/denoland/deno/issues
|
||||||
|
|
||||||
|
@ -1194,7 +1194,7 @@ fn importmap_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||||
.long_help(
|
.long_help(
|
||||||
"UNSTABLE:
|
"UNSTABLE:
|
||||||
Load import map file
|
Load import map file
|
||||||
Docs: https://deno.land/std/manual.md#import-maps
|
Docs: https://deno.land/manual/linking_to_external_code/import_maps
|
||||||
Specification: https://wicg.github.io/import-maps/
|
Specification: https://wicg.github.io/import-maps/
|
||||||
Examples: https://github.com/WICG/import-maps#the-import-map",
|
Examples: https://github.com/WICG/import-maps#the-import-map",
|
||||||
)
|
)
|
||||||
|
|
2
cli/js/lib.deno.ns.d.ts
vendored
2
cli/js/lib.deno.ns.d.ts
vendored
|
@ -1640,7 +1640,7 @@ declare namespace Deno {
|
||||||
|
|
||||||
/** Receive metrics from the privileged side of Deno. This is primarily used
|
/** Receive metrics from the privileged side of Deno. This is primarily used
|
||||||
* in the development of Deno. 'Ops', also called 'bindings', are the go-between
|
* in the development of Deno. 'Ops', also called 'bindings', are the go-between
|
||||||
* between Deno Javascript and Deno Rust.
|
* between Deno JavaScript and Deno Rust.
|
||||||
*
|
*
|
||||||
* > console.table(Deno.metrics())
|
* > console.table(Deno.metrics())
|
||||||
* ┌─────────────────────────┬────────┐
|
* ┌─────────────────────────┬────────┐
|
||||||
|
|
2
cli/js/lib.deno.unstable.d.ts
vendored
2
cli/js/lib.deno.unstable.d.ts
vendored
|
@ -652,7 +652,7 @@ declare namespace Deno {
|
||||||
/** **UNSTABLE**: new API, yet to be vetted.
|
/** **UNSTABLE**: new API, yet to be vetted.
|
||||||
*
|
*
|
||||||
* `bundle()` is part the compiler API. A full description of this functionality
|
* `bundle()` is part the compiler API. A full description of this functionality
|
||||||
* can be found in the [manual](https://deno.land/std/manual.md#denobundle).
|
* can be found in the [manual](https://deno.land/manual/runtime/compiler_apis#denobundle).
|
||||||
*
|
*
|
||||||
* Takes a root module name, and optionally a record set of sources. Resolves
|
* Takes a root module name, and optionally a record set of sources. Resolves
|
||||||
* with a single JavaScript string (and bundle diagnostics if issues arise with
|
* with a single JavaScript string (and bundle diagnostics if issues arise with
|
||||||
|
|
|
@ -128,9 +128,8 @@ pub enum Snapshot {
|
||||||
Boxed(Box<[u8]>),
|
Boxed(Box<[u8]>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents data used to initialize isolate at startup
|
/// Represents data used to initialize an isolate at startup, either
|
||||||
/// either a binary snapshot or a javascript source file
|
/// in the form of a binary snapshot or a JavaScript source file.
|
||||||
/// in the form of the StartupScript struct.
|
|
||||||
pub enum StartupData<'a> {
|
pub enum StartupData<'a> {
|
||||||
Script(Script<'a>),
|
Script(Script<'a>),
|
||||||
Snapshot(Snapshot),
|
Snapshot(Snapshot),
|
||||||
|
@ -142,7 +141,7 @@ type IsolateErrorHandleFn = dyn FnMut(ErrBox) -> Result<(), ErrBox>;
|
||||||
|
|
||||||
/// A single execution context of JavaScript. Corresponds roughly to the "Web
|
/// A single execution context of JavaScript. Corresponds roughly to the "Web
|
||||||
/// Worker" concept in the DOM. An CoreIsolate is a Future that can be used with
|
/// Worker" concept in the DOM. An CoreIsolate is a Future that can be used with
|
||||||
/// Tokio. The CoreIsolate future complete when there is an error or when all
|
/// Tokio. The CoreIsolate future completes when there is an error or when all
|
||||||
/// pending ops have completed.
|
/// pending ops have completed.
|
||||||
///
|
///
|
||||||
/// Ops are created in JavaScript by calling Deno.core.dispatch(), and in Rust
|
/// Ops are created in JavaScript by calling Deno.core.dispatch(), and in Rust
|
||||||
|
|
|
@ -45,8 +45,14 @@ or imports having unnecessary file extensions.
|
||||||
|
|
||||||
The community has developed extensions for some editors to solve these issues:
|
The community has developed extensions for some editors to solve these issues:
|
||||||
|
|
||||||
- [VS Code](https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-deno)
|
#### VS Code
|
||||||
by [@axetroy](https://github.com/axetroy).
|
|
||||||
|
The beta version of [vscode_deno](https://github.com/denoland/vscode_deno) is
|
||||||
|
published on the
|
||||||
|
[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=justjavac.vscode-deno).
|
||||||
|
Please report any issues.
|
||||||
|
|
||||||
|
#### JetBrains IDEs
|
||||||
|
|
||||||
Support for JetBrains IDEs is not yet available, but you can follow and upvote
|
Support for JetBrains IDEs is not yet available, but you can follow and upvote
|
||||||
these issues to stay up to date:
|
these issues to stay up to date:
|
||||||
|
@ -55,6 +61,14 @@ these issues to stay up to date:
|
||||||
- https://youtrack.jetbrains.com/issue/WEB-42983
|
- https://youtrack.jetbrains.com/issue/WEB-42983
|
||||||
- https://youtrack.jetbrains.com/issue/WEB-31667
|
- https://youtrack.jetbrains.com/issue/WEB-31667
|
||||||
|
|
||||||
|
#### Vim and NeoVim
|
||||||
|
|
||||||
|
Vim works fairly well for Deno/TypeScript if you install
|
||||||
|
[CoC](https://github.com/neoclide/coc.nvim) (intellisense engine and language
|
||||||
|
server protocol). After CoC itself is installed, from inside Vim, simply run
|
||||||
|
`:CocInstall coc-deno`. From now on, things like `gd` (go to definition) and
|
||||||
|
`gr` (goto/find references) should work.
|
||||||
|
|
||||||
If you don't see your favorite IDE on this list, maybe you can develop an
|
If you don't see your favorite IDE on this list, maybe you can develop an
|
||||||
extension. Our [community Discord group](https://discord.gg/TGMHGv6) can give
|
extension. Our [community Discord group](https://discord.gg/TGMHGv6) can give
|
||||||
you some pointers on where to get started.
|
you some pointers on where to get started.
|
||||||
|
|
|
@ -66,5 +66,5 @@ got unload event in event handler (main)
|
||||||
```
|
```
|
||||||
|
|
||||||
All listeners added using `window.addEventListener` were run, but
|
All listeners added using `window.addEventListener` were run, but
|
||||||
`window.onload` and `window.onunload` defined in `main.ts` overridden handlers
|
`window.onload` and `window.onunload` defined in `main.ts` overrode handlers
|
||||||
defined in `imported.ts`.
|
defined in `imported.ts`.
|
||||||
|
|
|
@ -35,7 +35,7 @@ This is very much a work-in-progress. I'm actively soliciting feedback.
|
||||||
format each element according to the format (surrounded by [] and separated by
|
format each element according to the format (surrounded by [] and separated by
|
||||||
comma) (`<` Mnemonic: pull each element out of array)
|
comma) (`<` Mnemonic: pull each element out of array)
|
||||||
|
|
||||||
- how to deal with more newfangled Javascript features ( generic Iterables, Map
|
- how to deal with more newfangled JavaScript features (generic Iterables, Map
|
||||||
and Set types, typed Arrays, ...)
|
and Set types, typed Arrays, ...)
|
||||||
|
|
||||||
- the implementation is fairly rough around the edges:
|
- the implementation is fairly rough around the edges:
|
||||||
|
|
|
@ -4,7 +4,8 @@ fs module is made to provide helpers to manipulate the filesystem.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
All the following modules are exposed in `mod.ts`
|
All the following modules are exposed in `mod.ts` This feature is currently
|
||||||
|
unstable. To enable it use `deno run --unstable`
|
||||||
|
|
||||||
### emptyDir
|
### emptyDir
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ ensureSymlink("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // ret
|
||||||
ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // void
|
ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // void
|
||||||
```
|
```
|
||||||
|
|
||||||
### eol
|
### EOL
|
||||||
|
|
||||||
Detects and format the passed string for the targeted End Of Line character.
|
Detects and format the passed string for the targeted End Of Line character.
|
||||||
|
|
||||||
|
@ -91,21 +92,6 @@ exists("./foo"); // returns a Promise<boolean>
|
||||||
existsSync("./foo"); // returns boolean
|
existsSync("./foo"); // returns boolean
|
||||||
```
|
```
|
||||||
|
|
||||||
### globToRegExp
|
|
||||||
|
|
||||||
Generate a regex based on glob pattern and options This was meant to be using
|
|
||||||
the the `fs.walk` function but can be used anywhere else.
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { globToRegExp } from "https://deno.land/std/fs/mod.ts";
|
|
||||||
|
|
||||||
globToRegExp("foo/**/*.json", {
|
|
||||||
flags: "g",
|
|
||||||
extended: true,
|
|
||||||
globstar: true,
|
|
||||||
}); // returns the regex to find all .json files in the folder foo
|
|
||||||
```
|
|
||||||
|
|
||||||
### move
|
### move
|
||||||
|
|
||||||
Moves a file or directory. Overwrites it if option provided
|
Moves a file or directory. Overwrites it if option provided
|
||||||
|
|
|
@ -43,7 +43,7 @@ export function emptyDirSync(dir: string): void {
|
||||||
try {
|
try {
|
||||||
const items = [...readDirSync(dir)];
|
const items = [...readDirSync(dir)];
|
||||||
|
|
||||||
// if directory already exist. then remove it's child item.
|
// If the directory exists, remove all entries inside it.
|
||||||
while (items.length) {
|
while (items.length) {
|
||||||
const item = items.shift();
|
const item = items.shift();
|
||||||
if (item && item.name) {
|
if (item && item.name) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export interface Cookie {
|
||||||
path?: string;
|
path?: string;
|
||||||
/** Indicates if the cookie is made using SSL & HTTPS. */
|
/** Indicates if the cookie is made using SSL & HTTPS. */
|
||||||
secure?: boolean;
|
secure?: boolean;
|
||||||
/** Indicates that cookie is not accessible via Javascript. **/
|
/** Indicates that cookie is not accessible via JavaScript. **/
|
||||||
httpOnly?: boolean;
|
httpOnly?: boolean;
|
||||||
/** Allows servers to assert that a cookie ought not to
|
/** Allows servers to assert that a cookie ought not to
|
||||||
* be sent along with cross-site requests. */
|
* be sent along with cross-site requests. */
|
||||||
|
|
|
@ -67,7 +67,7 @@ export async function readLong(buf: BufReader): Promise<number | null> {
|
||||||
// We probably should provide a similar API that returns BigInt values.
|
// We probably should provide a similar API that returns BigInt values.
|
||||||
if (big > MAX_SAFE_INTEGER) {
|
if (big > MAX_SAFE_INTEGER) {
|
||||||
throw new RangeError(
|
throw new RangeError(
|
||||||
"Long value too big to be represented as a Javascript number."
|
"Long value too big to be represented as a JavaScript number."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Number(big);
|
return Number(big);
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
# The manual has moved to //docs
|
|
|
@ -5,3 +5,18 @@ Usage:
|
||||||
```ts
|
```ts
|
||||||
import * as path from "https://deno.land/std/path/mod.ts";
|
import * as path from "https://deno.land/std/path/mod.ts";
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### globToRegExp
|
||||||
|
|
||||||
|
Generate a regex based on glob pattern and options This was meant to be using
|
||||||
|
the the `fs.walk` function but can be used anywhere else.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { globToRegExp } from "https://deno.land/std/path/glob.ts";
|
||||||
|
|
||||||
|
globToRegExp("foo/**/*.json", {
|
||||||
|
flags: "g",
|
||||||
|
extended: true,
|
||||||
|
globstar: true,
|
||||||
|
}); // returns the regex to find all .json files in the folder foo
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue